From 6e0b97846169f47d9c1c60a11adf26392081f43a Mon Sep 17 00:00:00 2001 From: Hamish Mackenzie Date: Tue, 6 Feb 2024 10:49:17 +1300 Subject: [PATCH] Get OnBlocked from `base` --- GHCJS/Concurrent.hs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/GHCJS/Concurrent.hs b/GHCJS/Concurrent.hs index 9f113eb..f863993 100644 --- a/GHCJS/Concurrent.hs +++ b/GHCJS/Concurrent.hs @@ -34,6 +34,7 @@ module GHCJS.Concurrent ( isThreadSynchronous ) where import GHC.JS.Prim +import GHC.JS.Foreign.Callback (OnBlocked(..)) import Control.Applicative import Control.Concurrent @@ -48,18 +49,6 @@ import Data.Typeable import Unsafe.Coerce -{- | - The runtime tries to run synchronous threads to completion. Sometimes it's - not possible to continue running a thread, for example when the thread - tries to take an empty 'MVar'. The runtime can then either throw a - 'WouldBlockException', aborting the blocking action, or continue the - thread asynchronously. - -} - -data OnBlocked = ContinueAsync -- ^ continue the thread asynchronously if blocked - | ThrowWouldBlock -- ^ throw 'WouldBlockException' if blocked - deriving (Data, Typeable, Enum, Show, Eq, Ord) - {- | Run the action without the scheduler preempting the thread. When a blocking action is encountered, the thread is still suspended and will continue