fn record_waker(&self, waker_key: &mut usize, cx: &mut Context<'_>) {
        #[cfg(feature = "std")]
        let mut wakers_guard = self.notifier.wakers.lock().unwrap();
        #[cfg(not(feature = "std"))]
        let mut wakers_guard = self.notifier.wakers.lock();

        let wakers_mut = wakers_guard.as_mut();

        let wakers = match wakers_mut {
            Some(wakers) => wakers,
            None => return,
        };

        let new_waker = cx.waker();

        if *waker_key == NULL_WAKER_KEY {
            *waker_key = wakers.insert(Some(new_waker.clone()));
        } else {
            match wakers[*waker_key] {
                Some(ref old_waker) if new_waker.will_wake(old_waker) => {}
                // Could use clone_from here, but Waker doesn't specialize it.
                ref mut slot => *slot = Some(new_waker.clone()),
            }
        }
        debug_assert!(*waker_key != NULL_WAKER_KEY);
    }
Registers the current task to receive a wakeup when we are awoken.
futures-util/src/future/future/shared.rs