#5553: sendWakeup error in simple test program with MVars and killThread
-----------------------+----------------------------------------------------
    Reporter:  bit     |       Owner:  tibbe                      
        Type:  bug     |      Status:  new                        
    Priority:  normal  |   Component:  Runtime System             
     Version:  7.2.1   |    Keywords:                             
    Testcase:          |   Blockedby:                             
          Os:  Linux   |    Blocking:                             
Architecture:  x86     |     Failure:  Incorrect result at runtime
-----------------------+----------------------------------------------------
Changes (by tibbe):

  * owner:  => tibbe


Comment:

 I've assigned the ticket to myself but I'm pretty swamped right now so if
 someone else has time feel free to take a look.

 `sendWakeup` is defined in `GHC/Event/Control.hs` and is used to wake up
 the I/O manager every time a new file descriptor or timeout (i.e.
 `threadDelay`) is added. Here's the relevant code:

 {{{
 sendWakeup :: Control -> IO ()
 #if defined(HAVE_EVENTFD)
 sendWakeup c = alloca $ \p -> do
   poke p (1 :: Word64)
   throwErrnoIfMinus1_ "sendWakeup" $
     c_write (fromIntegral (controlEventFd c)) (castPtr p) 8
 #else
 sendWakeup c = do
   n <- sendMessage (wakeupWriteFd c) CMsgWakeup
   case n of
     _ | n /= -1   -> return ()
       | otherwise -> do
                    errno <- getErrno
                    when (errno /= eAGAIN && errno /= eWOULDBLOCK) $
                      throwErrno "sendWakeup"
 #endif
 }}}

 Since you're on Linux the first `#if` case applies.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5553#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to