Module sgx_tstd::sync [−][src]
The Intel(R) Software Guard Extensions SDK already supports mutex and conditional variable synchronization mechanisms by means of the following APIand data types defined in the Types and Enumerations section. Some functions included in the trusted Thread Synchronization library may make calls outside the enclave (OCALLs). If you use any of the APIs below, you must first import the needed OCALL functions from sgx_tstdc.edl. Otherwise, you will get a linker error when the enclave is being built; see Calling Functions outside the Enclave for additional details. The table below illustrates the primitives that the Intel(R) SGX Thread Synchronization library supports, as well as the OCALLs that each API function needs.
Modules
atomic |
Atomic types |
Structs
Arc |
A thread-safe reference-counting pointer. 'Arc' stands for 'Atomically Reference Counted'. |
Barrier |
A barrier enables multiple threads to synchronize the beginning of some computation. |
BarrierWaitResult |
A |
Once |
A synchronization primitive which can be used to run a one-time global
initialization. Useful for one-time initialization for FFI or related
functionality. This type can only be constructed with the |
OnceState |
State yielded to the |
PoisonError |
A type of error which can be returned whenever a lock is acquired. |
SgxCondvar |
A Condition Variable |
SgxMutex |
A mutual exclusion primitive useful for protecting shared data |
SgxMutexGuard |
An RAII implementation of a "scoped lock" of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked. |
SgxReentrantMutex |
A re-entrant mutual exclusion |
SgxReentrantMutexGuard |
An RAII implementation of a "scoped lock" of a mutex. When this structure is dropped (falls out of scope), the lock will be unlocked. |
SgxReentrantThreadMutex |
The structure of sgx mutex. |
SgxRwLock |
A reader-writer lock |
SgxRwLockReadGuard |
RAII structure used to release the shared read access of a lock when dropped. |
SgxRwLockWriteGuard |
RAII structure used to release the exclusive write access of a lock when dropped. |
SgxSpinlock | |
SgxSpinlockGuard | |
SgxThreadCondvar |
The structure of sgx condition. |
SgxThreadMutex |
The structure of sgx mutex. |
SgxThreadRwLock |
An OS-based reader-writer lock. |
SgxThreadSpinlock | |
Weak |
|
Enums
TryLockError |
An enumeration of possible errors associated with a |
Constants
ONCE_INIT |
Initialization value for static |
Type Definitions
LockResult |
A type alias for the result of a lock method which can be poisoned. |
TryLockResult |
A type alias for the result of a nonblocking locking method. |