#7032: sleep fails for compiled program
-------------------------------+--------------------------------------------
Reporter: carl | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.6.1
Component: Compiler | Version: 7.4.2
Keywords: | Os: Linux
Architecture: x86_64 (amd64) | Failure: Incorrect result at runtime
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
-------------------------------+--------------------------------------------
Comment(by pcapriotti):
According to the man page of `sleep`:
{{{
sleep() makes the calling thread sleep until seconds seconds have elapsed
or a signal arrives which is not ignored.
}}}
Since we use `SIGVTALRM` for the RTS clock, `sleep` is always going to be
interrupted immediately. Normally, you should use `threadDelay`, which
will also let other threads run (even without `-threaded`).
The attached patch explains this problem in the documentation for `sleep`,
and adds a `WARNING` pragma.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7032#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs