Struct sgx_tstd::sync::SgxThreadRwLock [−][src]
pub struct SgxThreadRwLock { /* fields omitted */ }An OS-based reader-writer lock.
This structure is entirely unsafe and serves as the lowest layer of a cross-platform binding of system rwlocks. It is recommended to use the safer types at the top level of this crate instead of this type.
Methods
impl SgxThreadRwLock[src]
impl SgxThreadRwLockpub const fn new() -> Self[src]
pub const fn new() -> SelfCreates a new reader-writer lock for use.
pub unsafe fn read(&self) -> SysError[src]
pub unsafe fn read(&self) -> SysErrorAcquires shared access to the underlying lock, blocking the current thread to do so.
pub unsafe fn try_read(&self) -> SysError[src]
pub unsafe fn try_read(&self) -> SysErrorAttempts to acquire shared access to this lock, returning whether it succeeded or not.
This function does not block the current thread.
pub unsafe fn write(&self) -> SysError[src]
pub unsafe fn write(&self) -> SysErrorAcquires write access to the underlying lock, blocking the current thread to do so.
pub unsafe fn try_write(&self) -> SysError[src]
pub unsafe fn try_write(&self) -> SysErrorAttempts to acquire exclusive access to this lock, returning whether it succeeded or not.
This function does not block the current thread.
pub unsafe fn read_unlock(&self) -> SysError[src]
pub unsafe fn read_unlock(&self) -> SysErrorUnlocks previously acquired shared access to this lock.
pub unsafe fn write_unlock(&self) -> SysError[src]
pub unsafe fn write_unlock(&self) -> SysErrorUnlocks previously acquired exclusive access to this lock.
pub unsafe fn destroy(&self) -> SysError[src]
pub unsafe fn destroy(&self) -> SysErrorDestroys OS-related resources with this RWLock.
Trait Implementations
impl Send for SgxThreadRwLock[src]
impl Send for SgxThreadRwLockimpl Sync for SgxThreadRwLock[src]
impl Sync for SgxThreadRwLock