/// Unlocks the mutex
///
/// This is expected to be only called from the current holder of the mutex.
/// The method returns the `Waker` which is associated with the task that
/// needs to get woken due to the unlock.
Unlocks the mutex
This is expected to be only called from the current holder of the mutex.
The method returns the `Waker` which is associated with the task that
needs to get woken due to the unlock.
Unlocks the mutex This is expected to be only called from the current holder of the mutex . The method returns the ` Waker ` which is associated with the task that needs to get woken due to the unlock .
fn unlock(&mut self) -> Option<Waker> {
        if self.is_locked {
            self.is_locked = false;
            // TODO: Does this require a memory barrier for the actual data,
            // or is this covered by unlocking the mutex which protects the data?
            // Wakeup the last waiter
            self.return_last_waiter()
        } else {
            None
        }
    }
fn unlock ( & mut self ) -> Option < Waker > { if self . is_locked { self . is_locked = false ; // TODO: Does this require a memory barrier for the actual data, // or is this covered by unlocking the mutex which protects the data? // Wakeup the last waiter self . return_last_waiter ( ) } else { None } }
Unlocks the mutex
This is expected to be only called from the current holder of the mutex.
Unlocks the mutex This is expected to be only called from the current holder of the mutex .
&mut self