From: simonmar Date: Wed, 27 Apr 2005 12:54:45 +0000 (+0000) Subject: [project @ 2005-04-27 12:54:45 by simonmar] X-Git-Tag: Initial_conversion_from_CVS_complete~656 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=f74aec1b45761416675c8cae58adf5fd6c3f4e76;p=ghc-hetmet.git [project @ 2005-04-27 12:54:45 by simonmar] Some extra sanity checking --- diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index baf5e1d..036c5b0 100644 --- a/ghc/rts/Schedule.c +++ b/ghc/rts/Schedule.c @@ -476,6 +476,15 @@ schedule( StgMainThread *mainThread USED_WHEN_RTS_SUPPORTS_THREADS, // We now have a capability... #endif + +#if 0 /* extra sanity checking */ + { + StgMainThread *m; + for (m = main_threads; m != NULL; m = m->link) { + ASSERT(get_itbl(m->tso)->type == TSO); + } + } +#endif // Check whether we have re-entered the RTS from Haskell without // going via suspendThread()/resumeThread (i.e. a 'safe' foreign @@ -1819,6 +1828,7 @@ scheduleHandleThreadFinished( StgMainThread *mainThread removeThreadLabel((StgWord)mainThread->tso->id); #endif if (mainThread->prev == NULL) { + ASSERT(mainThread == main_threads); main_threads = mainThread->link; } else { mainThread->prev->link = mainThread->link;