[project @ 2003-12-15 16:23:54 by simonmar]
authorsimonmar <unknown>
Mon, 15 Dec 2003 16:23:54 +0000 (16:23 +0000)
committersimonmar <unknown>
Mon, 15 Dec 2003 16:23:54 +0000 (16:23 +0000)
commit56a125f20635ab93b34b50bbfe0d2c1280d560ba
treefcb1dbe9685dcefba48d256f97e068ceaf92fb7f
parent622da08564f02443b40426a19c25f82e89071cac
[project @ 2003-12-15 16:23:54 by simonmar]
Fix a deadlock: an OS thread returning from a C call could enter
grabReturnCapability, grabbing the capability that was in the process
of being passed to another thread via passCapability.  This leads to a
deadlock shortly afterward, because the passCapability flag is still
set, so a normal worker won't pick up the capability when it is
released.

Fix (not sure if this is the best fix, though): don't grab the
capability in grabReturnCapability() if passCapabilty is set.
ghc/rts/Capability.c