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

Method map_current

src/thread_pool.rs:1174–1198  ·  view source on GitHub ↗
(f: F)

Source from the content-addressed store, hash-verified

1172 // broadcasts.
1173 if (resignations >> 26) - 1 == 0 {
1174 atomic_wait::wake_all(&*thread_pool.resignations);
1175 }
1176 // Exit the CAS loop.
1177 break;
1178 }
1179 }
1180
1181 // Swap back to pointing to the previous value (possibly null).
1182 WORKER_PTR.with(|ptr| ptr.set(outer_ptr));
1183
1184 // The worker is fully torn down, so panics may unwind freely again.
1185 core::mem::forget(abort_guard);
1186
1187 // If the closure panicked, re-raise it now that teardown is complete so
1188 // that it propagates to the caller. Otherwise return its result.
1189 match result {
1190 Ok(result) => result,
1191 Err(panic) => unwind::resume_unwinding(panic),
1192 }
1193 }
1194
1195 /// Returns a reference to the push-side `Sharer` queue for this
1196 /// worker's seat.
1197 #[inline(always)]
1198 fn sharing_queue(&self) -> &'static Sharer<JobRef> {
1199 &self.member_data.sharers[self.member_index]
1200 }
1201

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected