Provide blockedOnDeadMVar, blockedIndefinitely for the RTS
authorIan Lynagh <igloo@earth.li>
Thu, 21 Aug 2008 11:07:23 +0000 (11:07 +0000)
committerIan Lynagh <igloo@earth.li>
Thu, 21 Aug 2008 11:07:23 +0000 (11:07 +0000)
GHC/IOBase.lhs

index d55be42..c15d6c7 100644 (file)
@@ -47,7 +47,8 @@ module GHC.IOBase(
     throwIO, block, unblock, blocked, catchAny, catchException,
     evaluate,
     ErrorCall(..), AssertionFailed(..), assertError, untangle,
-    BlockedOnDeadMVar(..), BlockedIndefinitely(..), Deadlock(..)
+    BlockedOnDeadMVar(..), BlockedIndefinitely(..), Deadlock(..),
+    blockedOnDeadMVar, blockedIndefinitely
   ) where
 
 import GHC.ST
@@ -641,6 +642,9 @@ instance Exception BlockedOnDeadMVar
 instance Show BlockedOnDeadMVar where
     showsPrec _ BlockedOnDeadMVar = showString "thread blocked indefinitely"
 
+blockedOnDeadMVar :: SomeException -- for the RTS
+blockedOnDeadMVar = toException BlockedOnDeadMVar
+
 -----
 
 data BlockedIndefinitely = BlockedIndefinitely
@@ -651,6 +655,9 @@ instance Exception BlockedIndefinitely
 instance Show BlockedIndefinitely where
     showsPrec _ BlockedIndefinitely = showString "thread blocked indefinitely"
 
+blockedIndefinitely :: SomeException -- for the RTS
+blockedIndefinitely = toException BlockedIndefinitely
+
 -----
 
 data Deadlock = Deadlock