/// Lock the mutex, returning the inner content. After doing this, it's
/// your responsibility to unlock it after usage. Mostly useful for FFI:
/// Prefer normal .lock() where possible.
Lock the mutex, returning the inner content. After doing this, it's
your responsibility to unlock it after usage. Mostly useful for FFI:
Prefer normal .lock() where possible.
Lock the mutex returning the inner content . After doing this it ' s your responsibility to unlock it after usage . Mostly useful for FFI : Prefer normal . lock () where possible .
pub unsafe fn manual_lock(&self) -> &mut T {
        self.lock.wait_until(
            |lock| {
                lock.compare_exchange_weak(UNLOCKED, LOCKED, SeqCst, SeqCst)
                    .map(|_| AttemptStatus::Desired)
                    .unwrap_or_else(|e| match e {
                        WAITING => AttemptStatus::Waiting,
                        _ => AttemptStatus::Other,
                    })
            },
            |lock| match lock
                .compare_exchange_weak(LOCKED, WAITING, SeqCst, SeqCst)
                .unwrap_or_else(|e| e)
            {
                UNLOCKED => AttemptStatus::Desired,
                WAITING => AttemptStatus::Waiting,
                _ => AttemptStatus::Other,
            },
            WAITING,
        );
        &mut *self.content.get()
    }
pub unsafe fn manual_lock ( & self ) -> & mut T { self . lock . wait_until ( | lock | { lock . compare_exchange_weak ( UNLOCKED , LOCKED , SeqCst , SeqCst ) . map ( | _ | AttemptStatus :: Desired ) . unwrap_or_else ( | e | match e { WAITING => AttemptStatus :: Waiting , _ => AttemptStatus :: Other , } ) } , | lock | match lock . compare_exchange_weak ( LOCKED , WAITING , SeqCst , SeqCst ) . unwrap_or_else ( | e | e ) { UNLOCKED => AttemptStatus :: Desired , WAITING => AttemptStatus :: Waiting , _ => AttemptStatus :: Other , } , WAITING , ) ; & mut * self . content . get ( ) }
Lock the mutex, returning the inner content.
Lock the mutex returning the inner content .
&self