MCPcopy Create free account
hub / github.com/NthTensor/Forte / block_on

Method block_on

src/thread_pool.rs:695–704  ·  view source on GitHub ↗
(&'static self, future: F)

Source from the content-addressed store, hash-verified

693 // sound to call `execute_runnable` on `job_pointer`. This requires:
694 //
695 // * That `job_pointer` was produced by `Runnable::into_raw` and not
696 // yet consumed by `Runnable::from_raw`. We produced it with
697 // `into_raw` immediately above. The only call to `from_raw` is
698 // inside `execute_runnable`, which runs at most once because
699 // `JobRef::execute` consumes the `JobRef`.
700 //
701 // * If the future is `!Send`, `execute_runnable` is only called on
702 // the thread the future was spawned on.
703 //
704 // The second clause of the `Spawn<M>::spawn` safety contract
705 // requires the caller to ensure this.
706 let job_ref = unsafe { JobRef::new(job_pointer, execute_runnable) };
707

Callers 1

block_onFunction · 0.80

Calls 6

block_onFunction · 0.85
get_workerMethod · 0.80
new_latchMethod · 0.80
pollMethod · 0.80
wait_forMethod · 0.80
resetMethod · 0.80

Tested by

no test coverage detected