fn remove_waiter(&mut self, wait_node: &mut ListNode<WaitQueueEntry>) {
        // SemaphoreAcquireFuture only needs to get removed if it had been added to
        // the wait queue of the Semaphore. This has happened in the PollState::Waiting case.
        // If the current waiter was notified, another waiter must get notified now.
        match wait_node.state {
            PollState::Notified => {
                if self.is_fair {
                    // In a fair Mutex, the WaitQueueEntry is kept in the
                    // linked list and must be removed here
                    // Safety: Due to the state, we know that the node must be part
                    // of the waiter list
                    unsafe { self.force_remove_waiter(wait_node) };
                }
                wait_node.state = PollState::Done;
                // Wakeup more waiters
                self.wakeup_waiters();
            }
            PollState::Waiting => {
                // Remove the WaitQueueEntry from the linked list
                // Safety: Due to the state, we know that the node must be part
                // of the waiter list
                unsafe { self.force_remove_waiter(wait_node) };
                wait_node.state = PollState::Done;
            }
            PollState::New | PollState::Done => {}
        }
    }
/// Removes the waiter from the list.
/// This function is only safe as long as the reference that is passed here
/// equals the reference/address under which the waiter was added.
/// The waiter must not have been moved in between.
Removes the waiter from the list.
This function is only safe as long as the reference that is passed here
equals the reference/address under which the waiter was added.
The waiter must not have been moved in between.
Removes the waiter from the list . This function is only safe as long as the reference that is passed here equals the reference / address under which the waiter was added . The waiter must not have been moved in between .
fn remove_waiter(&mut self, wait_node: &mut ListNode<WaitQueueEntry>) {
        // SemaphoreAcquireFuture only needs to get removed if it had been added to
        // the wait queue of the Semaphore. This has happened in the PollState::Waiting case.
        // If the current waiter was notified, another waiter must get notified now.
        match wait_node.state {
            PollState::Notified => {
                if self.is_fair {
                    // In a fair Mutex, the WaitQueueEntry is kept in the
                    // linked list and must be removed here
                    // Safety: Due to the state, we know that the node must be part
                    // of the waiter list
                    unsafe { self.force_remove_waiter(wait_node) };
                }
                wait_node.state = PollState::Done;
                // Wakeup more waiters
                self.wakeup_waiters();
            }
            PollState::Waiting => {
                // Remove the WaitQueueEntry from the linked list
                // Safety: Due to the state, we know that the node must be part
                // of the waiter list
                unsafe { self.force_remove_waiter(wait_node) };
                wait_node.state = PollState::Done;
            }
            PollState::New | PollState::Done => {}
        }
    }
fn remove_waiter ( & mut self , wait_node : & mut ListNode < WaitQueueEntry > ) { // SemaphoreAcquireFuture only needs to get removed if it had been added to // the wait queue of the Semaphore. This has happened in the PollState::Waiting case. // If the current waiter was notified, another waiter must get notified now. match wait_node . state { PollState :: Notified => { if self . is_fair { // In a fair Mutex, the WaitQueueEntry is kept in the // linked list and must be removed here // Safety: Due to the state, we know that the node must be part // of the waiter list unsafe { self . force_remove_waiter ( wait_node ) } ; } wait_node . state = PollState :: Done ; // Wakeup more waiters self . wakeup_waiters ( ) ; } PollState :: Waiting => { // Remove the WaitQueueEntry from the linked list // Safety: Due to the state, we know that the node must be part // of the waiter list unsafe { self . force_remove_waiter ( wait_node ) } ; wait_node . state = PollState :: Done ; } PollState :: New | PollState :: Done => { } } }
Removes the waiter from the list.
Removes the waiter from the list .
&mut self
wait_node
&mut ListNode<WaitQueueEntry>
&mut self
wait_node
&mut ListNode<WaitQueueEntry>