/* -----------------------------------------------------------------------------
- * $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
*
* Locks assumed : none
*/
void raiseAsync(StgTSO *tso, StgClosure *exception);
+void raiseAsyncWithLock(StgTSO *tso, StgClosure *exception);
/* awaitEvent()
*
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. */
#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__ */