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

Function num_members

src/thread_pool.rs:2496–2501  ·  view source on GitHub ↗

Returns the number of members participating in a thread-pool. When executed on a thread that is currently registered as a worker (i.e. the closure inside [`Membership::activate`], [`ThreadPool::with_worker`], or similar) this is able to look up that registration and find the worker and thread-pool implicitly. If not called within a thread pool, this uses the [`DEFAULT_POOL`].

()

Source from the content-addressed store, hash-verified

2494 // The `op` is `Send`, so this does not apply.
2495 //
2496 // * The function `op` must not unwind.
2497 //
2498 // `op` catches panics from the broadcast operation and passes
2499 // them to `ThreadPool::handle_panic`, which never unwinds.
2500 let job_ref = unsafe { job.into_job_ref() };
2501 self.member_data.broadcasts[member_index].push(job_ref);
2502 self.member_data.semaphores[member_index].signal();
2503 }
2504

Callers

nothing calls this directly

Calls 2

num_membersMethod · 0.80
thread_poolMethod · 0.80

Tested by

no test coverage detected