X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FSchedule.c;h=b2fb90ad0ed8d0408f695dc77f7a8dbdcab72f6b;hb=aa328192f6b09ad1c13038c719ac14db8daed121;hp=425551cb05a21e66f6c1cd35b449ad1e4d2be6c5;hpb=dfd7d6d02a597949b08161ae3d49dc6dfc9e812d;p=ghc-hetmet.git diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index 425551c..b2fb90a 100644 --- a/ghc/rts/Schedule.c +++ b/ghc/rts/Schedule.c @@ -1,5 +1,5 @@ /* --------------------------------------------------------------------------- - * $Id: Schedule.c,v 1.97 2001/07/23 17:23:19 simonmar Exp $ + * $Id: Schedule.c,v 1.102 2001/10/23 11:28:51 simonmar Exp $ * * (c) The GHC Team, 1998-2000 * @@ -74,6 +74,7 @@ //@node Includes, Variables and Data structures, Main scheduling code, Main scheduling code //@subsection Includes +#include "PosixSource.h" #include "Rts.h" #include "SchedAPI.h" #include "RtsUtils.h" @@ -444,6 +445,7 @@ schedule( void ) pthread_cond_broadcast(&m->wakeup); break; case ThreadKilled: + if (m->ret) *(m->ret) = NULL; *prev = m->link; if (was_interrupted) { m->stat = Interrupted; @@ -476,6 +478,7 @@ schedule( void ) m->stat = Success; return; } else { + if (m->ret) { *(m->ret) = NULL; }; if (was_interrupted) { m->stat = Interrupted; } else { @@ -581,12 +584,14 @@ schedule( void ) StgMainThread *m = main_threads; #ifdef SMP for (; m != NULL; m = m->link) { + deleteThread(m->tso); m->ret = NULL; m->stat = Deadlock; pthread_cond_broadcast(&m->wakeup); } main_threads = NULL; #else + deleteThread(m->tso); m->ret = NULL; m->stat = Deadlock; main_threads = m->link; @@ -2092,7 +2097,8 @@ take_off_run_queue(StgTSO *tso) { KH @ 25/10/99 */ -static void GetRoots(evac_fn evac) +static void +GetRoots(evac_fn evac) { StgMainThread *m; @@ -2920,7 +2926,7 @@ raiseAsync(StgTSO *tso, StgClosure *exception) } while (1) { - int words = ((P_)su - (P_)sp) - 1; + nat words = ((P_)su - (P_)sp) - 1; nat i; StgAP_UPD * ap;