[GHC] #4504: "awaitSignal Nothing" does not block thread with
-threaded
GHC
cvs-ghc at haskell.org
Wed Nov 17 02:41:09 EST 2010
#4504: "awaitSignal Nothing" does not block thread with -threaded
---------------------------------+------------------------------------------
Reporter: adept | Owner:
Type: bug | Status: new
Priority: normal | Component: Runtime System
Version: 7.0.1 | Keywords:
Testcase: | Blockedby:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: Incorrect result at runtime
---------------------------------+------------------------------------------
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.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4504>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list