Add interrupt_harness()

This commit is contained in:
Tony Garnock-Jones 2010-12-30 00:30:54 -05:00
parent dff260f74a
commit 420d53c511
2 changed files with 8 additions and 0 deletions

View File

@ -33,6 +33,7 @@ typedef unsigned char u_char;
# error Define STACK_SIZE for your platform. It should probably not be less than 32k?
#endif
static volatile int harness_running = 1;
Process *current_process = NULL;
#define EMPTY_PROCESS_QUEUE ((queue_t) { offsetof(Process, link), 0, NULL, NULL })
@ -234,7 +235,13 @@ void boot_harness(void) {
//info("Polling for events\n");
event_loop(EVLOOP_NONBLOCK);
}
if (!harness_running) break;
//info("Blocking for events\n");
event_loop(EVLOOP_ONCE);
}
}
void interrupt_harness(void) {
info("Interrupting harness\n");
harness_running = 0;
}

View File

@ -41,5 +41,6 @@ extern int iohandle_flush(IOHandle *h);
extern void iohandle_settimeout(IOHandle *h, int timeout_read, int timeout_write);
extern void boot_harness(void);
extern void interrupt_harness(void);
#endif