Add interrupt_harness()
This commit is contained in:
parent
dff260f74a
commit
420d53c511
|
@ -33,6 +33,7 @@ typedef unsigned char u_char;
|
||||||
# error Define STACK_SIZE for your platform. It should probably not be less than 32k?
|
# error Define STACK_SIZE for your platform. It should probably not be less than 32k?
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static volatile int harness_running = 1;
|
||||||
Process *current_process = NULL;
|
Process *current_process = NULL;
|
||||||
|
|
||||||
#define EMPTY_PROCESS_QUEUE ((queue_t) { offsetof(Process, link), 0, NULL, 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");
|
//info("Polling for events\n");
|
||||||
event_loop(EVLOOP_NONBLOCK);
|
event_loop(EVLOOP_NONBLOCK);
|
||||||
}
|
}
|
||||||
|
if (!harness_running) break;
|
||||||
//info("Blocking for events\n");
|
//info("Blocking for events\n");
|
||||||
event_loop(EVLOOP_ONCE);
|
event_loop(EVLOOP_ONCE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void interrupt_harness(void) {
|
||||||
|
info("Interrupting harness\n");
|
||||||
|
harness_running = 0;
|
||||||
|
}
|
||||||
|
|
|
@ -41,5 +41,6 @@ extern int iohandle_flush(IOHandle *h);
|
||||||
extern void iohandle_settimeout(IOHandle *h, int timeout_read, int timeout_write);
|
extern void iohandle_settimeout(IOHandle *h, int timeout_read, int timeout_write);
|
||||||
|
|
||||||
extern void boot_harness(void);
|
extern void boot_harness(void);
|
||||||
|
extern void interrupt_harness(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue