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

Method depopulate

src/thread_pool.rs:280–282  ·  view source on GitHub ↗

Removes all worker threads from the thread pool. This should only be done carefully, as blocking on an empty pool can cause a deadlock. See [`ThreadPool::resize_to`] for more information about resizing.

(&'static self)

Source from the content-addressed store, hash-verified

278 #[inline(always)]
279 pub fn push_shared_job(&'static self, job_ref: JobRef) {
280 self.shared_queue.push(job_ref);
281 // Try to wake up a worker to execute this job. This is relatively cheap
282 // if no workers are waiting. A searching worker will find the job
283 // without being woken, unless it is waiting on a `join`.
284 let waiting_bitmask = self.waiting_bitmask.load(Ordering::Relaxed);
285 let searching = self.searching.load(Ordering::Relaxed);

Callers 15

spawn_cancel_safetyFunction · 0.80
join_basicFunction · 0.80
join_deepFunction · 0.80
join_wideFunction · 0.80
scope_emptyFunction · 0.80
scope_resultFunction · 0.80
scope_twoFunction · 0.80
scope_borrowFunction · 0.80
scope_borrow_twiceFunction · 0.80
scope_futureFunction · 0.80

Calls 1

resize_toMethod · 0.80

Tested by 15

spawn_cancel_safetyFunction · 0.64
join_basicFunction · 0.64
join_deepFunction · 0.64
join_wideFunction · 0.64
scope_emptyFunction · 0.64
scope_resultFunction · 0.64
scope_twoFunction · 0.64
scope_borrowFunction · 0.64
scope_borrow_twiceFunction · 0.64
scope_futureFunction · 0.64