mirror of
https://github.com/janet-lang/janet
synced 2025-11-23 18:54:50 +00:00
Add utitities for interrupting the event loop.
janet_loop1_interrupt makes the event loop compatible with safe interruptions for custom scheduling. Does this by exposing custom events on the event loop. A custom event schedules a function pointer to run in a way that can interrupt epoll_wait/poll/GetQueuedCompletionStatus.
This commit is contained in:
@@ -56,9 +56,6 @@ void janet_vm_load(JanetVM *from) {
|
||||
* exit the interpeter loop when convenient. You can optionally
|
||||
* use NULL to interrupt the current VM when convenient */
|
||||
void janet_interpreter_interrupt(JanetVM *vm) {
|
||||
if (NULL == vm) {
|
||||
janet_vm.auto_suspend = 1;
|
||||
} else {
|
||||
vm->auto_suspend = 1;
|
||||
}
|
||||
vm = vm ? vm : &janet_vm;
|
||||
vm->auto_suspend = 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user