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 | let future = unsafe { Pin::new_unchecked(&mut **this.future.get()) }; |
| 866 | |
| 867 | // Create a new context from the waker, and poll the future. |
| 868 | let mut cx = Context::from_waker(&waker); |
| 869 | let result = unwind::halt_unwinding(|| future.poll(&mut cx)); |
| 870 | |
| 871 | // Update the job state depending on the outcome of polling the future. |
| 872 | // |
| 873 | // Out of an abundance of caution, we add an abort guard here. |
| 874 | let abort_guard = AbortOnDrop; |
| 875 | match result { |
| 876 | // The job completed without panicking. |
| 877 | Ok(Poll::Ready(())) => { |
| 878 | // Drop the future in place. State stays LOCKED, so it is never |