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

Method promote

src/thread_pool.rs:1246–1257  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

1244/// Every thread has at most one worker at a time. If a worker has already been
1245/// set up, it may be accessed at any time by calling [`Worker::with_current`].
1246/// A thread's worker can also be manually set up by claiming a membership
1247/// ([`ThreadPool::try_enroll`]) and passing it to [`Membership::activate`]. The
1248/// worker returned by `with_current` always represents the membership most
1249/// recently activated in the call stack.
1250///
1251/// Every worker belongs to exactly one thread pool, and must hold a membership
1252/// in one of the shared slots within that pool.
1253///
1254/// Workers have one core memory-safety guarantee: Any jobs added to the worker
1255/// will eventually be executed.
1256pub struct Worker {
1257 /// Registers the worker as belonging to a specific thread pool, and
1258 /// potentially also grants "membership" on that thread-pool.
1259 pub(crate) membership: Membership,
1260 /// A sequence of jobs waiting to be executed. Newer jobs are executed

Callers 2

yield_nowMethod · 0.80
joinMethod · 0.80

Calls 3

ticksFunction · 0.85
getMethod · 0.80
promote_coldMethod · 0.80

Tested by

no test coverage detected