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

Function join

src/thread_pool.rs:2406–2417  ·  view source on GitHub ↗

Executes the two closures, possibly in parallel. 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`]. If you have a reference to a [`

(a: A, b: B)

Source from the content-addressed store, hash-verified

2404 //
2405 // In either case, we cannot move or drop the `StackJob` -- by
2406 // returning or by unwinding -- until we pass the branch marked with
2407 // "(*)". We clearly do not return early, and unwinding is ruled out
2408 // by the abort guard held from before the `JobRef` is pushed until
2409 // after that branch: a panic that would unwind this frame in that
2410 // region aborts the process instead. (Jobs executed while waiting
2411 // never allow panics to escape their execution -- see the panic
2412 // convention on `JobRef` -- so only unexpected panics can trip the
2413 // guard.)
2414 let job_ref = unsafe { stack_job.as_job_ref() };
2415
2416 // Store the id of the `JobRef` for later, when we will need it to
2417 // safely recover the closure `a` for inline execution.
2418 let job_ref_id = job_ref.id();
2419
2420 // Once the job is pushed, other threads may hold references to

Callers 1

sumFunction · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected