rts_evalStableIO: start the new thread in blocked mode
authorSimon Marlow <marlowsd@gmail.com>
Wed, 9 Jul 2008 13:54:47 +0000 (13:54 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 9 Jul 2008 13:54:47 +0000 (13:54 +0000)
rts/RtsAPI.c

index 716b4a2..2496af3 100644 (file)
@@ -491,6 +491,9 @@ rts_evalStableIO (Capability *cap, HsStablePtr s, /*out*/HsStablePtr *ret)
     
     p = (StgClosure *)deRefStablePtr(s);
     tso = createStrictIOThread(cap, RtsFlags.GcFlags.initialStkSize, p);
     
     p = (StgClosure *)deRefStablePtr(s);
     tso = createStrictIOThread(cap, RtsFlags.GcFlags.initialStkSize, p);
+    // async exceptions are always blocked by default in the created
+    // thread.  See #1048.
+    tso->flags |= TSO_BLOCKEX | TSO_INTERRUPTIBLE;
     cap = scheduleWaitThread(tso,&r,cap);
     stat = rts_getSchedStatus(cap);
 
     cap = scheduleWaitThread(tso,&r,cap);
     stat = rts_getSchedStatus(cap);