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

Function scope_future

src/scope.rs:1094–1107  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1092 /// hold "ownership" of one such strong reference.
1093 unsafe fn wake(this: *const ()) {
1094 // SAFETY: `this` came from `Arc::into_raw` and the caller transfers
1095 // ownership of one strong count (per the contract), so `from_raw` may
1096 // reclaim it.
1097 let this = unsafe { Arc::from_raw(this.cast::<Self>()) };
1098
1099 // This wake publishes no data of its own; it only needs the READY ->
1100 // WOKEN transition to be atomic so exactly one waker enqueues the job.
1101 // Hence the `Relaxed` ordering. The future's state is ordered by the
1102 // poll's `Release` store and the enqueue/dequeue handoff, not by this
1103 // swap.
1104 if this.state.swap(WOKEN, Ordering::Relaxed) == READY {
1105 Worker::with_current(|worker| this.schedule(worker));
1106 }
1107 }
1108
1109 /// Queues self to be executed without consuming the waker.
1110 ///

Callers

nothing calls this directly

Calls 4

resize_to_availableMethod · 0.80
scopeMethod · 0.80
depopulateMethod · 0.80
spawnMethod · 0.45

Tested by

no test coverage detected