On Tue, Aug 30, 2011 at 6:49 AM, Bas van Dijk <v.dijk.bas@gmail.com> wrote:

As you see I also kill the thread which is running the event manager
loop. However I think this is not the right way to do it because when
I use the library I see the following message being continually
printed after the `Ctx` is finalized:

ghc: ioManagerWakeup: write: Bad file descriptor

I'm afraid we don't provide a way to shut down an event manager synchronously at the moment. You'll have to submit a patch if you want to add that capability.  Perhaps you could add a way to specify an "onShutdown :: IO ()" hook that would be called by the event manager thread once it shuts down.