[project @ 2005-11-11 10:37:35 by simonmar]
authorsimonmar <unknown>
Fri, 11 Nov 2005 10:37:35 +0000 (10:37 +0000)
committersimonmar <unknown>
Fri, 11 Nov 2005 10:37:35 +0000 (10:37 +0000)
Fix bugs in new signal handling machinery

GHC/Conc.lhs

index f1b4d61..c447060 100644 (file)
@@ -619,8 +619,9 @@ service_loop wakeup readfds writefds ptimeval old_reqs old_delays = do
            s <- peek p         
            if (s == 0xff) 
              then return ()
-             else do sp <- peekElemOff handlers (fromIntegral s)
-                     quickForkIO (deRefStablePtr sp)
+             else do handler_tbl <- peek handlers
+                     sp <- peekElemOff handler_tbl (fromIntegral s)
+                     quickForkIO (do io <- deRefStablePtr sp; io)
                      return ()
 
   takeMVar prodding
@@ -646,7 +647,7 @@ prodServiceThread = do
     else return ()
   putMVar prodding True
 
-foreign import ccall "&signal_handlers" handlers :: Ptr (StablePtr (IO ()))
+foreign import ccall "&signal_handlers" handlers :: Ptr (Ptr (StablePtr (IO ())))
 
 foreign import ccall "setIOManagerPipe"
   c_setIOManagerPipe :: CInt -> IO ()