mirror of
https://github.com/janet-lang/janet
synced 2025-11-18 08:15:13 +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:
@@ -118,7 +118,7 @@
|
||||
if ((COND) && janet_vm.auto_suspend) { \
|
||||
janet_vm.auto_suspend = 0; \
|
||||
fiber->flags |= (JANET_FIBER_RESUME_NO_USEVAL | JANET_FIBER_RESUME_NO_SKIP); \
|
||||
vm_return(JANET_SIGNAL_EVENT, janet_wrap_nil()); \
|
||||
vm_return(JANET_SIGNAL_INTERRUPT, janet_wrap_nil()); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user