mirror of
https://github.com/janet-lang/janet
synced 2024-11-25 01:37:19 +00:00
ffd79c6097
Instead of setting a flag, each interrupt increments an atomic counter. When the interrupt is finally handled, either by scheduling code to run on the event loop or executing some out of band code, the user must now decrement the interrupt counter with janet_interpreter_interrupt_handled. While this counter is non-zero, the event loop will not enter the interpreter. This changes the API a bit but makes it possible and easy to handle signals without race conditions or scheduler hacks, as the runtime can ensure that high priority code is run before re-entering possibly blocking interpreter code again. Also included is a new function janet_schedule_soon, which prepends to the task queue instead of appending, allowing interrupt handler to skip ahead of all other scheduled fibers. Lastly, also update meson default options to include the interpreter_interrupt code and raise a runtime error if os/sigaction is used with interpreter interrupt but that build option is not enabled.
32 lines
1.5 KiB
Meson
32 lines
1.5 KiB
Meson
option('git_hash', type : 'string', value : 'meson')
|
|
|
|
option('single_threaded', type : 'boolean', value : false)
|
|
option('nanbox', type : 'boolean', value : true)
|
|
option('dynamic_modules', type : 'boolean', value : true)
|
|
option('docstrings', type : 'boolean', value : true)
|
|
option('sourcemaps', type : 'boolean', value : true)
|
|
option('reduced_os', type : 'boolean', value : false)
|
|
option('assembler', type : 'boolean', value : true)
|
|
option('peg', type : 'boolean', value : true)
|
|
option('int_types', type : 'boolean', value : true)
|
|
option('prf', type : 'boolean', value : false)
|
|
option('net', type : 'boolean', value : true)
|
|
option('ev', type : 'boolean', value : true)
|
|
option('processes', type : 'boolean', value : true)
|
|
option('umask', type : 'boolean', value : true)
|
|
option('realpath', type : 'boolean', value : true)
|
|
option('simple_getline', type : 'boolean', value : false)
|
|
option('epoll', type : 'boolean', value : false)
|
|
option('kqueue', type : 'boolean', value : false)
|
|
option('interpreter_interrupt', type : 'boolean', value : true)
|
|
option('ffi', type : 'boolean', value : true)
|
|
option('ffi_jit', type : 'boolean', value : true)
|
|
|
|
option('recursion_guard', type : 'integer', min : 10, max : 8000, value : 1024)
|
|
option('max_proto_depth', type : 'integer', min : 10, max : 8000, value : 200)
|
|
option('max_macro_expand', type : 'integer', min : 1, max : 8000, value : 200)
|
|
option('stack_max', type : 'integer', min : 8096, max : 0x7fffffff, value : 0x7fffffff)
|
|
|
|
option('arch_name', type : 'string', value: '')
|
|
option('os_name', type : 'string', value: '')
|