summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compiler/GHC/Builtin/primops.txt.pp6
-rw-r--r--libraries/base/GHC/Conc/Sync.hs2
2 files changed, 6 insertions, 2 deletions
diff --git a/compiler/GHC/Builtin/primops.txt.pp b/compiler/GHC/Builtin/primops.txt.pp
index 672b831ac7..2512612b5b 100644
--- a/compiler/GHC/Builtin/primops.txt.pp
+++ b/compiler/GHC/Builtin/primops.txt.pp
@@ -2783,10 +2783,14 @@ primop ForkOp "fork#" GenPrimOp
, topDmd ] topDiv }
primop ForkOnOp "forkOn#" GenPrimOp
- Int# -> a -> State# RealWorld -> (# State# RealWorld, ThreadId# #)
+ Int# -> (State# RealWorld -> (# State# RealWorld, a #))
+ -> State# RealWorld -> (# State# RealWorld, ThreadId# #)
with
has_side_effects = True
out_of_line = True
+ strictness = { \ _arity -> mkClosedDmdSig [ topDmd
+ , lazyApply1Dmd
+ , topDmd ] topDiv }
primop KillThreadOp "killThread#" GenPrimOp
ThreadId# -> a -> State# RealWorld -> State# RealWorld
diff --git a/libraries/base/GHC/Conc/Sync.hs b/libraries/base/GHC/Conc/Sync.hs
index 3a9f2bb533..ecae88cfc5 100644
--- a/libraries/base/GHC/Conc/Sync.hs
+++ b/libraries/base/GHC/Conc/Sync.hs
@@ -313,7 +313,7 @@ is recommended).
-}
forkOn :: Int -> IO () -> IO ThreadId
forkOn (I# cpu) action = IO $ \ s ->
- case (forkOn# cpu action_plus s) of (# s1, tid #) -> (# s1, ThreadId tid #)
+ case (forkOn# cpu (unIO action_plus) s) of (# s1, tid #) -> (# s1, ThreadId tid #)
where
-- We must use 'catch' rather than 'catchException' because the action
-- could be bottom. #13330