/* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.64 2000/04/05 15:28:59 simonmar Exp $
+ * $Id: Schedule.c,v 1.65 2000/04/07 09:47:38 simonmar Exp $
*
* (c) The GHC Team, 1998-2000
*
main_threads = NULL;
}
#else /* ! SMP */
- /*
- In GUM all non-main PEs come in here with no work;
- we ignore multiple main threads for now
-
if (blocked_queue_hd == END_TSO_QUEUE
- && run_queue_hd == END_TSO_QUEUE) {
- StgMainThread *m = main_threads;
- m->ret = NULL;
- m->stat = Deadlock;
- main_threads = m->link;
- return;
+ && run_queue_hd == END_TSO_QUEUE) {
+ StgMainThread *m = main_threads;
+ m->ret = NULL;
+ m->stat = Deadlock;
+ main_threads = m->link;
+ return;
}
- */
#endif
#ifdef SMP
/* grab a thread from the run queue
*/
+ ASSERT(run_queue_hd != END_TSO_QUEUE);
t = POP_RUN_QUEUE();
IF_DEBUG(sanity,checkTSO(t));
RELEASE_LOCK(&sched_mutex);
-#if defined(GRAN) || defined(PAR)
- IF_DEBUG(scheduler, belch("-->> Running TSO %ld (%p) %s ...",
+ IF_DEBUG(scheduler, sched_belch("-->> Running TSO %ld (%p) %s ...",
t->id, t, whatNext_strs[t->what_next]));
-#else
- IF_DEBUG(scheduler,sched_belch("running thread %d", t->id));
-#endif
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
/* Run the current thread
* case it'll be on the relevant queue already.
*/
IF_DEBUG(scheduler,
- fprintf(stderr, "--<< thread %d (%p) stopped ", t->id, t);
+ fprintf(stderr, "--<< thread %d (%p) stopped: ", t->id, t);
printThreadBlockage(t);
fprintf(stderr, "\n"));
SET_HDR((StgClosure*)tso->sp,(StgInfoTable *)&stg_stop_thread_info,CCS_SYSTEM);
tso->su = (StgUpdateFrame*)tso->sp;
- IF_DEBUG(scheduler,belch("---- Initialised TSO %ld (%p), stack size = %lx words",
- tso->id, tso, tso->stack_size));
-
// ToDo: check this
#if defined(GRAN)
tso->link = END_TSO_QUEUE;
PUSH_ON_RUN_QUEUE(tso);
THREAD_RUNNABLE();
+#if 0
IF_DEBUG(scheduler,printTSO(tso));
+#endif
RELEASE_LOCK(&sched_mutex);
}