pub fn new(value: T) -> Self {
        Self {
            lock: libc::PTHREAD_RWLOCK_INITIALIZER,
            data: UnsafeCell::new(value),
        }
    }
/// Create a new uninitialized lock.
///
/// Note that the lock can still be moved around freely. However, you
/// can't actually acquire it yet. Initialize or attach the lock by
/// calling `initialize` or `acquire`.
///
/// We are not using a RAII API here, because we can't guarantee that the
/// initializing process outlives other attaching processes. Destroying
/// a lock that's still in use by other processes is highly unsafe.
///
/// We use a two-step initialization procedure because we need two types:
/// One type to hold the actual data and one type that holds a reference
/// to that data, and as such avoids accidentally moving or modifying the
/// data.
Create a new uninitialized lock.
Note that the lock can still be moved around freely. However, you
can't actually acquire it yet. Initialize or attach the lock by
calling `initialize` or `acquire`.

We are not using a RAII API here, because we can't guarantee that the
initializing process outlives other attaching processes. Destroying
a lock that's still in use by other processes is highly unsafe.

We use a two-step initialization procedure because we need two types:
One type to hold the actual data and one type that holds a reference
to that data, and as such avoids accidentally moving or modifying the
data.
Create a new uninitialized lock . Note that the lock can still be moved around freely . However you can ' t actually acquire it yet . Initialize or attach the lock by calling ` initialize ` or ` acquire ` . We are not using a RAII API here because we can ' t guarantee that the initializing process outlives other attaching processes . Destroying a lock that ' s still in use by other processes is highly unsafe . We use a two - step initialization procedure because we need two types : One type to hold the actual data and one type that holds a reference to that data and as such avoids accidentally moving or modifying the data .
pub fn new(value: T) -> Self {
        Self {
            lock: libc::PTHREAD_RWLOCK_INITIALIZER,
            data: UnsafeCell::new(value),
        }
    }
pub fn new ( value : T ) -> Self { Self { lock : libc :: PTHREAD_RWLOCK_INITIALIZER , data : UnsafeCell :: new ( value ) , } }
Create a new uninitialized lock.
Create a new uninitialized lock .
value
T
value
T