unsafe fn dec(this: *mut Self) -> bool {
        let count = (*this).count.get();

        if count == 0 {
            process::abort();
        }

        let count = count - 1;
        (*this).count.set(count);

        if count != 0 {
            return false;
        }

        let this = Box::from_raw(this);

        if this.access.is_taken() {
            // NB: This prevents the inner `T` from being dropped in case it
            // has already been taken (as indicated by `is_taken`).
            //
            // If it has been taken, the shared box contains invalid memory.
            drop(std::mem::transmute::<_, Box<SharedBox<ManuallyDrop<T>>>>(
                this,
            ));
        } else {
            // NB: At the point of the final drop, no on else should be using
            // this.
            debug_assert!(
                this.access.is_exclusive(),
                "expected exclusive, but was: {:?}",
                this.access
            );
        }

        true
    }
/// Decrement the reference count in inner, and free the underlying data if
/// it has reached zero.
///
/// # Safety
///
/// ProtocolCaller needs to ensure that `this` is a valid pointer.
Decrement the reference count in inner, and free the underlying data if
it has reached zero.
Decrement the reference count in inner and free the underlying data if it has reached zero .
unsafe fn dec(this: *mut Self) -> bool {
        let count = (*this).count.get();
        if count == 0 {
            process::abort();
        }
        let count = count - 1;
        (*this).count.set(count);
        if count != 0 {
            return false;
        }
        let this = Box::from_raw(this);
        if this.access.is_taken() {
            // NB: This prevents the inner `T` from being dropped in case it
            // has already been taken (as indicated by `is_taken`).
            //
            // If it has been taken, the shared box contains invalid memory.
            drop(std::mem::transmute::<_, Box<SharedBox<ManuallyDrop<T>>>>(
                this,
            ));
        } else {
            // NB: At the point of the final drop, no on else should be using
            // this.
            debug_assert!(
                this.access.is_exclusive(),
                "expected exclusive, but was: {:?}",
                this.access
            );
        }
        true
    }
unsafe fn dec ( this : * mut Self ) -> bool { let count = ( * this ) . count . get ( ) ; if count == 0 { process :: abort ( ) ; } let count = count - 1 ; ( * this ) . count . set ( count ) ; if count != 0 { return false ; } let this = Box :: from_raw ( this ) ; if this . access . is_taken ( ) { // NB: This prevents the inner `T` from being dropped in case it // has already been taken (as indicated by `is_taken`). // // If it has been taken, the shared box contains invalid memory. drop ( std :: mem :: transmute :: < _ , Box < SharedBox < ManuallyDrop < T > > > > ( this , ) ) ; } else { // NB: At the point of the final drop, no on else should be using // this. debug_assert ! ( this access is_exclusive ( ) " " this access ) ; } true }
Decrement the reference count in inner, and free the underlying data if
it has reached zero.
Decrement the reference count in inner and free the underlying data if it has reached zero .
this
*mut Self
this
*mut Self
safety
ProtocolCaller needs to ensure that `this` is a valid pointer.
ProtocolCaller needs to ensure that ` this ` is a valid pointer .