
30 Aug
2011
30 Aug
'11
11:11 p.m.
On 31 August 2011 00:15, Bas van Dijk
I see what I can do. I'm first going to export the 'finished' function from GHC.Event and use that to wait till the loop finishes and see if that solves my problem.
Waiting till the loop finishes doesn't solve the problem. Here's an isolated program with the same problem that doesn't use the usb library: import Control.Concurrent import GHC.Event main = do em <- new forkIO $ loop em threadDelay 2000000 shutdown em threadDelay 2000000 When executed it prints: example: ioManagerWakeup: write: Bad file descriptor example: ioManagerDie: write: Bad file descriptor So it seems like a bug in GHC. I will create a ticket in the morning. Regards, Bas