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

Function join_basic

src/thread_pool.rs:2571–2583  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2569/// Runs work on the background on a specific worker thread.
2570///
2571/// This is quite similar to [`spawn`], except that the work will run on another
2572/// worker instead of the current one.
2573///
2574/// If not called within a thread pool, this uses the [`DEFAULT_POOL`].
2575///
2576/// If you have a reference to a [`Worker`], it's better to use
2577/// [`Worker::spawn_on`] instead. If you don't have a worker, but know which
2578/// thread pool you want to use, [`ThreadPool::spawn_on`] is more appropriate.
2579pub fn spawn_on<M, S>(member_index: usize, work: S) -> S::Output
2580where
2581 S: Spawn<M> + Send,
2582 S::Output: Send,
2583{
2584 Worker::with_current(|worker| match worker {
2585 Some(worker) => worker.spawn_on(member_index, work),
2586 None => DEFAULT_POOL.spawn_on(member_index, work),

Callers

nothing calls this directly

Calls 3

resize_to_availableMethod · 0.80
joinMethod · 0.80
depopulateMethod · 0.80

Tested by

no test coverage detected