Struct sgx_sync::StaticRwLock
source · pub struct StaticRwLock(/* private fields */);
Expand description
An SGX-based reader-writer lock., meant for use in static variables.
This rwlock has a const constructor (StaticRwLock::new
), does not
implement Drop
to cleanup resources.
Implementations§
source§impl StaticRwLock
impl StaticRwLock
pub const fn new() -> StaticRwLock
sourcepub fn read(&'static self) -> StaticRwLockReadGuard
pub fn read(&'static self) -> StaticRwLockReadGuard
Acquires shared access to the underlying lock, blocking the current thread to do so.
The lock is automatically unlocked when the returned guard is dropped.
sourcepub fn write(&'static self) -> StaticRwLockWriteGuard
pub fn write(&'static self) -> StaticRwLockWriteGuard
Acquires write access to the underlying lock, blocking the current thread to do so.
The lock is automatically unlocked when the returned guard is dropped.
Trait Implementations§
impl Sync for StaticRwLock
Auto Trait Implementations§
impl RefUnwindSafe for StaticRwLock
impl Send for StaticRwLock
impl Unpin for StaticRwLock
impl UnwindSafe for StaticRwLock
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more