From 90d88088ee8b3697ce68f7b1e07506bc4f33687d Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 7 Jun 2006 11:51:05 +0000 Subject: [PATCH] Remove unnecessary SCHED_INTERRUPTED scheduler state --- rts/Schedule.c | 9 ++------- rts/Schedule.h | 3 +-- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/rts/Schedule.c b/rts/Schedule.c index c652e18..46f575e 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -416,8 +416,6 @@ schedule (Capability *initialCapability, Task *task) // needs to acquire all the capabilities). We can't kill // threads involved in foreign calls. // - // * sched_state := SCHED_INTERRUPTED - // // * somebody calls shutdownHaskell(), which calls exitScheduler() // // * sched_state := SCHED_SHUTTING_DOWN @@ -443,9 +441,6 @@ schedule (Capability *initialCapability, Task *task) /* scheduleDoGC() deletes all the threads */ cap = scheduleDoGC(cap,task,rtsFalse,GetRoots); break; - case SCHED_INTERRUPTED: - IF_DEBUG(scheduler, sched_belch("SCHED_INTERRUPTED")); - break; case SCHED_SHUTTING_DOWN: IF_DEBUG(scheduler, sched_belch("SCHED_SHUTTING_DOWN")); // If we are a worker, just exit. If we're a bound thread @@ -2060,7 +2055,7 @@ scheduleDoGC (Capability *cap, Task *task USED_IF_THREADS, */ if (sched_state >= SCHED_INTERRUPTING) { deleteAllThreads(&capabilities[0]); - sched_state = SCHED_INTERRUPTED; + sched_state = SCHED_SHUTTING_DOWN; } /* everybody back, start the GC. @@ -2901,7 +2896,7 @@ exitScheduler( void ) #endif // If we haven't killed all the threads yet, do it now. - if (sched_state < SCHED_INTERRUPTED) { + if (sched_state < SCHED_SHUTTING_DOWN) { sched_state = SCHED_INTERRUPTING; scheduleDoGC(NULL,task,rtsFalse,GetRoots); } diff --git a/rts/Schedule.h b/rts/Schedule.h index 37b0794..edbe246 100644 --- a/rts/Schedule.h +++ b/rts/Schedule.h @@ -117,8 +117,7 @@ extern int RTS_VAR(context_switch); */ #define SCHED_RUNNING 0 /* running as normal */ #define SCHED_INTERRUPTING 1 /* ^C detected, before threads are deleted */ -#define SCHED_INTERRUPTED 2 /* ^C detected, after threads deleted */ -#define SCHED_SHUTTING_DOWN 3 /* final shutdown */ +#define SCHED_SHUTTING_DOWN 2 /* final shutdown */ extern rtsBool RTS_VAR(sched_state); -- 1.7.10.4