Ticket #4504 (closed bug: fixed)
"awaitSignal Nothing" does not block thread with -threaded
|Reported by:||adept||Owned by:|
|Type of failure:||Incorrect result at runtime||Difficulty:|
|Test Case:||Blocked By:|
Consider the following code:
module Main where import System.Posix.Signals import Control.Concurrent main :: IO () main = do awaitSignal Nothing >> yield
According to the System.Posix.Signals haddock, "awaitSignal Nothing" should call pause(2), causing main thread to block until some signal has arrived. This is indeed what happens when this code is compiled by GHC 7.0.1 like so: "ghc --make awaitSignal.hs".
However, when compiled with -threaded, this code exits immediately when run. I think this is a bug in -threaded runtime.
I've tested with GHC 6.12.1, and this behavior is present there as well. Maybe I'm missing something non-obvious here?
My environment: x86, Debian sid, GHC 6.12.1 from Debian packages, GHC 7.0.1 from binary packages from GHC site.