Queues self to be executed and consumes 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 ())
| 865 | // Clone a strong reference so the allocation, and therefore the |
| 866 | // `scheduler` field, stays alive for the entire `schedule` call. |
| 867 | // |
| 868 | // `into_job_ref` consumes `self` via `Arc::into_raw`, moving our strong |
| 869 | // reference into the `JobRef` *without* decrementing the count. The act |
| 870 | // of calling `schedule` enqueues that `JobRef`, after which another |
| 871 | // worker may execute and drop it before `schedule` returns. Holding |
| 872 | // `this` keeps an independent strong reference alive until the end of |
| 873 | // this function, so borrowing `this.scheduler` across the call cannot |
| 874 | // dangle. |
| 875 | let this = Arc::clone(&self); |
| 876 | let job_ref = self.into_job_ref(); |
| 877 | this.scheduler.schedule(job_ref, worker); |
| 878 | } |