diff --git a/doc/simh_doc.doc b/doc/simh_doc.doc index 56ea8167..324442a2 100644 Binary files a/doc/simh_doc.doc and b/doc/simh_doc.doc differ diff --git a/scp.c b/scp.c index 8815d89a..0b0bc50a 100644 --- a/scp.c +++ b/scp.c @@ -1782,7 +1782,8 @@ ASSERT failure have several different actions: " Pause for NUMBER seconds. SUFFIX may be 's' for seconds (the default),\n" " 'm' for minutes, 'h' for hours or 'd' for days. NUMBER may be an\n" " arbitrary floating point number. Given two or more arguments, pause\n" - " for the amount of time specified by the sum of their values.\n\n" + " for the amount of time specified by the sum of their values.\n" + " NOTE: A SLEEP command is interruptable with SIGINT (^C).\n\n" /***************** 80 character line width template *************************/ #define HLP_ASSERT "*Commands Executing_Command_Files Testing_Simulator_State" #define HLP_IF "*Commands Executing_Command_Files Testing_Simulator_State" @@ -3961,6 +3962,8 @@ t_stat sleep_cmd (int32 flag, CONST char *cptr) char *tptr; double wait; +stop_cpu = 0; +signal (SIGINT, int_handler); while (*cptr) { wait = strtod (cptr, &tptr); switch (*tptr) { @@ -3988,15 +3991,18 @@ while (*cptr) { wait *= (24.0*60.0*60.0); break; default: + signal (SIGINT, SIG_DFL); /* cancel WRU */ return sim_messagef (SCPE_ARG, "Invalid Sleep unit '%c'\n", *cptr); } wait *= 1000.0; /* Convert to Milliseconds */ cptr = tptr; - while (wait > 1000.0) + while ((wait > 1000.0) && (!stop_cpu)) wait -= sim_os_ms_sleep (1000); - if (wait > 0.0) + if ((wait > 0.0) && (!stop_cpu)) sim_os_ms_sleep ((unsigned)wait); } +signal (SIGINT, SIG_DFL); /* cancel WRU */ +stop_cpu = 0; return SCPE_OK; }