From dee7135cfb9e6c302faa6bdb683f75a4e99f31f9 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 25 Apr 2015 03:49:48 -0700 Subject: [PATCH] SCP: More immediate detection of changed stop_cpu during event processing. --- scp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scp.c b/scp.c index 875689a5..c436e984 100644 --- a/scp.c +++ b/scp.c @@ -8264,7 +8264,8 @@ do { AIO_EVENT_COMPLETE(uptr, reason); } while ((reason == SCPE_OK) && (sim_interval <= 0) && - (sim_clock_queue != QUEUE_LIST_END)); + (sim_clock_queue != QUEUE_LIST_END) && + (!stop_cpu)); if (sim_clock_queue == QUEUE_LIST_END) { /* queue empty? */ sim_interval = noqueue_time = NOQUEUE_WAIT; /* flag queue empty */ @@ -8273,6 +8274,8 @@ if (sim_clock_queue == QUEUE_LIST_END) { /* queue empty? */ else sim_debug (SIM_DBG_EVENT, sim_dflt_dev, "Processing Queue Complete New Interval = %d(%s)\n", sim_interval, sim_uname(sim_clock_queue)); +if ((reason == SCPE_OK) && stop_cpu) + reason = SCPE_STOP; return reason; }