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

Method wake_by_ref

src/scope.rs:883–897  ·  view source on GitHub ↗

Queues self to be executed without consuming the waker. # Safety Must be called with a pointer created by calling `Arc::into_raw` on an instance of `Arc ` that is still alive.

(this: *const ())

Source from the content-addressed store, hash-verified

881 ///
882 /// # Panics
883 ///
884 /// This function does not unwind. Panics that occur while running the job
885 /// are caught with `catch_unwind` and stored on the scope. Other panics,
886 /// such as those emitted by drop-glue, may cause aborts.
887 ///
888 /// # Safety
889 ///
890 /// `this` must be a pointer produced by `Arc::into_raw` on an `Arc<Self>`.
891 ///
892 /// This call takes ownership of exactly one strong reference count for that
893 /// allocation, consuming it via `Arc::from_raw` internally. The caller must
894 /// hold "ownership" of one such strong reference.
895 unsafe fn poll(this: NonNull<()>, worker: &Worker) {
896 // While we still have a raw pointer to the job, create a raw task waker
897 // using our vtable.
898 let raw_waker =
899 RawWaker::new(this.as_ptr().cast_const(), &Self::VTABLE);
900

Callers 1

pollMethod · 0.45

Calls 1

scheduleMethod · 0.45

Tested by

no test coverage detected