Function simics::api::simulator::callbacks::_run_in_thread

source ·
fn _run_in_thread<F>(cb: F)
where F: FnOnce() -> Result<()> + 'static,
Expand description

Run a closure in a new thread.

run_in_thread schedules the callback f to run on a separate thread. The callback will run in Threaded Context and must observe the associated restrictions. Simics maintains a pool of worker threads used by this function, and hence the callback can typically be started quickly.

The callback is allowed to block or otherwise run for a long time.

The user supplied arg parameter is passed unmodified to the callback.

§Context

Any Context Callback: Threaded Context