dpx.infinity:
> Hi,
> I'm writing a program which listens to some D-Bus signals using
> DBus.Client.onSignal function from dbus-client package. This function
> runs IO action in separate haskell thread when signal is received. My
> program does nothing except signal handling, so after setting up
> signals it has to wait indefinitely. Now I'm using not very clean (I
> think so) forever $ threadDelay 10000000 . Is there another (I mean,
> correct) method to do this thing?

Block on an MVar that will be set by the child thread when it
terminates?

    main = do
        done <- newEmptyMVar

        forkIO $ do ... child code ...
                    putMVar done ()

        takeMVar done
        print "Child is done"
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to