Skip to content

Commit

Permalink
Get OnBlocked from base
Browse files Browse the repository at this point in the history
  • Loading branch information
hamishmack committed Feb 5, 2024
1 parent b23aa44 commit 6e0b978
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions GHCJS/Concurrent.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6e0b978

Please sign in to comment.