Commit ab89dc19 authored by Simon Marlow's avatar Simon Marlow

forkIO starts the new thread blocked if the parent is blocked (#1048)

parent a5f2ab64
......@@ -920,6 +920,12 @@ forkzh_fast
("ptr" threadid) = foreign "C" createIOThread( MyCapability() "ptr",
RtsFlags_GcFlags_initialStkSize(RtsFlags),
closure "ptr") [];
/* start blocked if the current thread is blocked */
StgTSO_flags(threadid) =
StgTSO_flags(threadid) | (StgTSO_flags(CurrentTSO) &
(TSO_BLOCKEX::I32 | TSO_INTERRUPTIBLE::I32));
foreign "C" scheduleThread(MyCapability() "ptr", threadid "ptr") [];
// switch at the earliest opportunity
......@@ -943,6 +949,12 @@ forkOnzh_fast
("ptr" threadid) = foreign "C" createIOThread( MyCapability() "ptr",
RtsFlags_GcFlags_initialStkSize(RtsFlags),
closure "ptr") [];
/* start blocked if the current thread is blocked */
StgTSO_flags(threadid) =
StgTSO_flags(threadid) | (StgTSO_flags(CurrentTSO) &
(TSO_BLOCKEX::I32 | TSO_INTERRUPTIBLE::I32));
foreign "C" scheduleThreadOn(MyCapability() "ptr", cpu, threadid "ptr") [];
// switch at the earliest opportunity
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment