[project @ 2002-04-19 10:25:00 by simonmar]
[ghc-hetmet.git] / ghc / rts / Schedule.h
index 10f950c..5ea4c5c 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: Schedule.h,v 1.30 2002/03/12 11:51:07 simonmar Exp $
+ * $Id: Schedule.h,v 1.33 2002/04/13 05:33:03 sof Exp $
  *
  * (c) The GHC Team 1998-1999
  *
@@ -58,6 +58,7 @@ StgTSO *unblockOne(StgTSO *tso);
  * Locks assumed   :  none
  */
 void raiseAsync(StgTSO *tso, StgClosure *exception);
+void raiseAsyncWithLock(StgTSO *tso, StgClosure *exception);
 
 /* awaitEvent()
  *
@@ -135,6 +136,7 @@ extern nat         rts_n_waiting_workers;
 extern nat         rts_n_waiting_tasks;
 #endif
 
+StgInt forkProcess(StgTSO *tso);
 
 /* Sigh, RTS-internal versions of waitThread(), scheduleThread(), and
    rts_evalIO() for the use by main() only. ToDo: better. */
@@ -267,9 +269,16 @@ void print_bqe (StgBlockingQueueElement *bqe);
 #define THREAD_RUNNABLE()  /* nothing */
 #endif
 
-/* Check whether the run queue is empty i.e. the PE is idle
+/* Check whether various thread queues are empty
  */
-#define EMPTY_RUN_QUEUE()     (run_queue_hd == END_TSO_QUEUE)
-#define EMPTY_QUEUE(q)        (q == END_TSO_QUEUE)
+#define EMPTY_QUEUE(q)         (q == END_TSO_QUEUE)
+
+#define EMPTY_RUN_QUEUE()      (EMPTY_QUEUE(run_queue_hd))
+#define EMPTY_BLOCKED_QUEUE()  (EMPTY_QUEUE(blocked_queue_hd))
+#define EMPTY_SLEEPING_QUEUE() (EMPTY_QUEUE(sleeping_queue))
+
+#define EMPTY_THREAD_QUEUES()  (EMPTY_RUN_QUEUE() && \
+                               EMPTY_BLOCKED_QUEUE() && \
+                               EMPTY_SLEEPING_QUEUE())
 
 #endif /* __SCHEDULE_H__ */