if (completed_hw == 0) {
/* empty table, drop lock and wait */
LeaveCriticalSection(&queue_lock);
- if ( wait && !interrupted ) {
+ if ( wait && sched_state == SCHED_RUNNING ) {
DWORD dwRes = WaitForMultipleObjects(2, wait_handles, FALSE, INFINITE);
switch (dwRes) {
case WAIT_OBJECT_0:
// If we're already trying to interrupt the RTS, terminate with
// extreme prejudice. So the first ^C tries to exit the program
// cleanly, and the second one just kills it.
- if (interrupted) {
+ if (sched_state >= SCHED_INTERRUPTING) {
stg_exit(EXIT_INTERRUPTED);
} else {
interruptStgRts();