summaryrefslogtreecommitdiff
path: root/rts/RaiseAsync.c
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2019-06-16 21:54:23 +0100
committerBen Gamari <ben@smart-cactus.org>2020-07-15 16:41:01 -0400
commit90e69f779b6da755fac472337535a1321cbb7917 (patch)
tree935ccfc0e38bfae2133b926347edb51bafecdfa7 /rts/RaiseAsync.c
parent356dc3feae967b1c361130f1f356ef9ad6a693e4 (diff)
downloadhaskell-90e69f779b6da755fac472337535a1321cbb7917.tar.gz
winio: Add IOPort synchronization primitive
Diffstat (limited to 'rts/RaiseAsync.c')
-rw-r--r--rts/RaiseAsync.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/rts/RaiseAsync.c b/rts/RaiseAsync.c
index e8a6a81747..719c05435d 100644
--- a/rts/RaiseAsync.c
+++ b/rts/RaiseAsync.c
@@ -174,11 +174,11 @@ throwToSelf (Capability *cap, StgTSO *tso, StgClosure *exception)
- or it is masking exceptions (TSO_BLOCKEX)
- Currently, if the target is BlockedOnMVar, BlockedOnSTM, or
- BlockedOnBlackHole then we acquire ownership of the TSO by locking
- its parent container (e.g. the MVar) and then raise the exception.
- We might change these cases to be more message-passing-like in the
- future.
+ Currently, if the target is BlockedOnMVar, BlockedOnSTM,
+ BlockedOnIOCompletion or BlockedOnBlackHole then we acquire ownership of the
+ TSO by locking its parent container (e.g. the MVar) and then raise the
+ exception. We might change these cases to be more message-passing-like in
+ the future.
Returns:
@@ -343,6 +343,7 @@ check_target:
case BlockedOnMVar:
case BlockedOnMVarRead:
+ case BlockedOnIOCompletion:
{
/*
To establish ownership of this TSO, we need to acquire a
@@ -367,7 +368,9 @@ check_target:
// we have the MVar, let's check whether the thread
// is still blocked on the same MVar.
- if ((target->why_blocked != BlockedOnMVar && target->why_blocked != BlockedOnMVarRead)
+ if ((target->why_blocked != BlockedOnMVar
+ && target->why_blocked != BlockedOnMVarRead
+ && target->why_blocked != BlockedOnIOCompletion)
|| (StgMVar *)target->block_info.closure != mvar) {
unlockClosure((StgClosure *)mvar, info);
goto retry;
@@ -679,6 +682,7 @@ removeFromQueues(Capability *cap, StgTSO *tso)
case BlockedOnMVar:
case BlockedOnMVarRead:
+ case BlockedOnIOCompletion:
removeFromMVarBlockedQueue(tso);
goto done;