pub fn join(self) -> std::thread::Result<T> {
        ExecutionState::with(|state| {
            let me = state.current().id();
            let target = state.get_mut(self.task_id);
            if target.set_waiter(me) {
                state.current_mut().block();
            }
        });

        // TODO can we soundly skip the yield if the target thread has already finished?
        thread::switch();

        self.result.lock().unwrap().take().expect("target should have finished")
    }
/// Waits for the associated thread to finish.
Waits for the associated thread to finish.
Waits for the associated thread to finish .
pub fn join(self) -> std::thread::Result<T> {
        ExecutionState::with(|state| {
            let me = state.current().id();
            let target = state.get_mut(self.task_id);
            if target.set_waiter(me) {
                state.current_mut().block();
            }
        });
        // TODO can we soundly skip the yield if the target thread has already finished?
        thread::switch();
        self.result.lock().unwrap().take().expect("target should have finished")
    }
pub fn join ( self ) -> std :: thread :: Result < T > { ExecutionState :: with ( | state | { let me = state . current ( ) . id ( ) ; let target = state . get_mut ( self . task_id ) ; if target . set_waiter ( me ) { state . current_mut ( ) . block ( ) ; } } ) ; // TODO can we soundly skip the yield if the target thread has already finished? thread :: switch ( ) ; self . result . lock ( ) . unwrap ( ) . take ( ) . expect ( " " ) }
Waits for the associated thread to finish.
Waits for the associated thread to finish .
self
self