pub fn process_work<F>(work: F) -> Result<()>
Expand description
process_work and process_pending_work processes work posted by thread_safe_callback and realtime_event. These process work functions are typically called when embedding Simics in another application to allow periodic and asynchronous Simics work to run while the simulation is not advancing. process_pending_work runs all work that has been queued up since the last call and returns immediately after.
process_work is similar but waits for new work to arrive. Each time some work has been processed, the supplied done callback is called with done_data as its only argument. A return value of 1 tells process_work to stop processing work and return control to the caller again while 0 tells it to continue.
The done predicate is only evaluated between callbacks that are run in Global Context, that is, not registered with the run_in_thread parameter set).
The process work functions return -1 if the user has pressed the interrupt key before or while they were running, provided that the simulator core was initialized to catch signals. Otherwise the return value is 0.
§Context
Global Context