[project @ 2003-09-12 16:32:13 by sof]
[ghc-hetmet.git] / ghc / rts / Schedule.c
index 1afc9fe..c58584f 100644 (file)
@@ -1,5 +1,5 @@
 /* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.170 2003/06/19 10:35:37 simonmar Exp $
+ * $Id: Schedule.c,v 1.173 2003/08/15 12:43:57 simonmar Exp $
  *
  * (c) The GHC Team, 1998-2000
  *
@@ -1513,7 +1513,7 @@ forkProcess(StgTSO* tso)
     
   } else { /* child */
   /* wipe all other threads */
-  run_queue_hd = run_queue_tl = tso;
+  run_queue_hd = run_queue_tl = END_TSO_QUEUE;
   tso->link = END_TSO_QUEUE;
 
   /* When clearing out the threads, we need to ensure
@@ -3103,6 +3103,9 @@ unblockThread(StgTSO *tso)
 
   case BlockedOnRead:
   case BlockedOnWrite:
+#if defined(mingw32_TARGET_OS)
+  case BlockedOnDoProc:
+#endif
     {
       /* take TSO off blocked_queue */
       StgBlockingQueueElement *prev = NULL;
@@ -3141,7 +3144,7 @@ unblockThread(StgTSO *tso)
          goto done;
        }
       }
-      barf("unblockThread (I/O): TSO not found");
+      barf("unblockThread (delay): TSO not found");
     }
 
   default:
@@ -3230,6 +3233,9 @@ unblockThread(StgTSO *tso)
 
   case BlockedOnRead:
   case BlockedOnWrite:
+#if defined(mingw32_TARGET_OS)
+  case BlockedOnDoProc:
+#endif
     {
       StgTSO *prev = NULL;
       for (t = blocked_queue_hd; t != END_TSO_QUEUE; 
@@ -3266,7 +3272,7 @@ unblockThread(StgTSO *tso)
          goto done;
        }
       }
-      barf("unblockThread (I/O): TSO not found");
+      barf("unblockThread (delay): TSO not found");
     }
 
   default:
@@ -3623,6 +3629,11 @@ printThreadBlockage(StgTSO *tso)
   case BlockedOnWrite:
     fprintf(stderr,"is blocked on write to fd %d", tso->block_info.fd);
     break;
+#if defined(mingw32_TARGET_OS)
+    case BlockedOnDoProc:
+    fprintf(stderr,"is blocked on proc (request: %d)", tso->block_info.async_result->reqID);
+    break;
+#endif
   case BlockedOnDelay:
     fprintf(stderr,"is blocked until %d", tso->block_info.target);
     break;