Re: openFd under -threaded gets interrupted

Quoth Mitar
Also is there any workaround possible in Haskell/GHC? For example making time while openFd is in progress without interrupts?
You might try something like this: import System.Posix.Signals ... setSignalMask fullSignalSet fd <- openFd ... setSignalMask emptySignalSet I'm not in a position to try it in exactly the same situation, but I see that when I run with all signals blocked as above, after a while I have a SIGALRM pending (with -threaded or not), so I reckon that might be the signal used by the runtime thread manager. If it works, I would recommend blocking only that signal during the openFd, so for example you'll be able to abort normally with SIGINT if the device is stuck. Donn

Hi!
On Fri, Dec 18, 2009 at 7:15 PM, Donn Cave
setSignalMask fullSignalSet fd <- openFd ... setSignalMask emptySignalSet
Thanks! This did it. At the end it is enough to block just virtualTimerExpired signal and it works. Probably it is something RTS is using internally? Mitar
participants (2)
-
Donn Cave
-
Mitar