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 SgxThreadRwLock
pub const fn new() -> Self
[src]
pub const fn new() -> Self
Creates a new reader-writer lock for use.
pub unsafe fn read(&self) -> SysError
[src]
pub unsafe fn read(&self) -> SysError
Acquires 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) -> SysError
Attempts 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) -> SysError
Acquires 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) -> SysError
Attempts 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) -> SysError
Unlocks previously acquired shared access to this lock.
pub unsafe fn write_unlock(&self) -> SysError
[src]
pub unsafe fn write_unlock(&self) -> SysError
Unlocks previously acquired exclusive access to this lock.
pub unsafe fn destroy(&self) -> SysError
[src]
pub unsafe fn destroy(&self) -> SysError
Destroys OS-related resources with this RWLock.
Trait Implementations
impl Send for SgxThreadRwLock
[src]
impl Send for SgxThreadRwLock
impl Sync for SgxThreadRwLock
[src]
impl Sync for SgxThreadRwLock