pub fn mark_want_write(&mut self) -> Option<UpgradableReadGuard<T>> {
        // We mark for write, by setting the MSB
        let try_mark = self.lock.fetch_or(MSB_MASK, Ordering::SeqCst);
        if try_mark < MSB_MASK {
            // If wasn't already set, return an upgradable lock
            Some(UpgradableReadGuard {
                lock: self.lock,
                data: self.data,
            })
        } else {
            None
        }
    }
/// Notify of an intent to upgrade the lock to a write lock
/// Returns None if another thread wants to write, or performs a write
Notify of an intent to upgrade the lock to a write lock
Returns None if another thread wants to write, or performs a write
Notify of an intent to upgrade the lock to a write lock Returns None if another thread wants to write or performs a write
pub fn mark_want_write(&mut self) -> Option<UpgradableReadGuard<T>> {
        // We mark for write, by setting the MSB
        let try_mark = self.lock.fetch_or(MSB_MASK, Ordering::SeqCst);
        if try_mark < MSB_MASK {
            // If wasn't already set, return an upgradable lock
            Some(UpgradableReadGuard {
                lock: self.lock,
                data: self.data,
            })
        } else {
            None
        }
    }
pub fn mark_want_write ( & mut self ) -> Option < UpgradableReadGuard < T > > { // We mark for write, by setting the MSB let try_mark = self . lock . fetch_or ( MSB_MASK , Ordering :: SeqCst ) ; if try_mark < MSB_MASK { // If wasn't already set, return an upgradable lock Some ( UpgradableReadGuard { lock : self . lock , data : self . data , } ) } else { None } }
Notify of an intent to upgrade the lock to a write lock
Returns None if another thread wants to write, or performs a write
Notify of an intent to upgrade the lock to a write lock Returns None if another thread wants to write or performs a write
&mut self
&mut self