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)
| 2404 | |
| 2405 | // Collect and return results or propagate panics. |
| 2406 | jobs.into_iter() |
| 2407 | .zip(error_flags) |
| 2408 | .map(|((_, job), error_flag)| { |
| 2409 | if error_flag { |
| 2410 | // SAFETY: `error_flag` (from `wait`) is `true`, so the job |
| 2411 | // completed with an error. |
| 2412 | let error = unsafe { job.unwrap_error() }; |
| 2413 | unwind::resume_unwinding(error); |
| 2414 | } else { |
| 2415 | // SAFETY: `error_flag` (from `wait`) is `false`, so the job |
| 2416 | // completed with a value. |
| 2417 | unsafe { job.unwrap_output() } |
| 2418 | } |
| 2419 | }) |
| 2420 | .collect() |