avoid a fork deadlock (see comments)
authorSimon Marlow <marlowsd@gmail.com>
Mon, 29 Mar 2010 13:23:29 +0000 (13:23 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Mon, 29 Mar 2010 13:23:29 +0000 (13:23 +0000)
rts/Schedule.c

index 70e0246..e3d025a 100644 (file)
@@ -1713,6 +1713,13 @@ forkProcess(HsStablePtr *entry
                // exception, but we do want to raiseAsync() because these
                // threads may be evaluating thunks that we need later.
                deleteThread_(cap,t);
+
+                // stop the GC from updating the InCall to point to
+                // the TSO.  This is only necessary because the
+                // OSThread bound to the TSO has been killed, and
+                // won't get a chance to exit in the usual way (see
+                // also scheduleHandleThreadFinished).
+                t->bound = NULL;
            }
           }
        }