From f74aec1b45761416675c8cae58adf5fd6c3f4e76 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 27 Apr 2005 12:54:45 +0000 Subject: [PATCH] [project @ 2005-04-27 12:54:45 by simonmar] Some extra sanity checking --- ghc/rts/Schedule.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; -- 1.7.10.4