Module preempt

Source
Expand description

Native preemption for managed code.

This module is used to regain control from managed code that would otherwise run indefinitely (or for a long time) without otherwise returning control to Shadow. When control is regained in this way, simulated time is moved forward some amount, and the current thread potentially rescheduled.

process_init should be called once per process, before any other methods are called.

enable should be called to enable preemption for the current thread, and disable to disable preemption for the current thread.

Functions§

disable
Disable preemption for the current thread.
enable
Enable preemption for the current thread.
process_init
Initialize state for the current native process. This does not yet actually enable preemption, which is done by calling enable.