While `preemption_check` can be passed to functions to control their preemption points, there is no way to inspect the state of the system after the preemption results in a yield. `preemption_source` is a superset of `preemption_check`, which also allows for customizing the yield, not just the preemption check. An implementation passed by a test can hook the yield to put the tested function to sleep, run some code, and then wake the function up. We use the preprocessor to minimize the impact on release builds. Only dev-mode preemption_source is hookable. When it's used in other modes, it should compile to direct reactor calls, as if it wasn't used.
1.7 KiB
1.7 KiB