Bugfixes for withThread and runInUnboundThread

Hello, I discovered two similar bugs in Control.Concurrent: * In the function: 'runInUnboundThread' a thread is forked which first installs an exception handler before performing the given IO computation. However it should first block asynchronous exceptions before forking the thread to ensure that the exception handler is always installed. In the attached patch I use the 'blockedApply' function which also ensures that the forked IO computation has the same blocked state as its parent thread. * There's a similar problem in the internal withThread function (which AFAIKS is only called in threadWaitRead). withThead also forgets to properly block asynchronous exceptions before forking a thread which needs to install an exception handler. In this case I didn't use blockedApply but only used block because withThread is only called with 'waitFd' which only performs an FFI call which can't receive asynchronous exceptions anyway. Should I make a bugreport or can this be applied immediately? regards, Bas

On Fri, Mar 26, 2010 at 11:57 PM, Bas van Dijk
Should I make a bugreport or can this be applied immediately?
I created a ticket for this so it's not forgotten: http://hackage.haskell.org/trac/ghc/ticket/3945 Bas
participants (1)
-
Bas van Dijk