Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor trap internals to formalize the distinction between regular and "synchronous" traps. See #101 for motivation. Also convert the "obvious" traps to make them sync traps.
Specifically, the following traps are made sync:
adjust_cancel_defer_depth
get_kernel
get_current
set_timeout
unset_timeout
queue_reschedule_function
clock
sigwatch
sigunwatch
The following traps in principle could be made sync, but either there's some complication or it isn't obvious whether those are actually the semantics we want, so I left them alone for now:
cancel_task
spawn
reschedule_tasks
When switching traps to make them synchronous I also renamed them. This isn't at all mandatory, but since the name of the trap = the name of the trap handler function, and sync trap handlers have a different calling convention than regular trap handlers, I thought it was helpful to have that reminder in the name of which kind of handler we're implementing.
This also contains some small cleanups to regular trap handling and adds some missing docs.