This group contains the Read-Write Lock implementation.
More...
This group contains the Read-Write Lock implementation.
◆ CORE_RWLOCK_THREAD_WAITING_FOR_READ
#define CORE_RWLOCK_THREAD_WAITING_FOR_READ 0 |
This is used to denote that a thread is blocking waiting for read-only access to the RWLock.
◆ CORE_RWLOCK_THREAD_WAITING_FOR_WRITE
#define CORE_RWLOCK_THREAD_WAITING_FOR_WRITE 1 |
This is used to denote that a thread is blocking waiting for write-exclusive access to the RWLock.
◆ CORE_RWLock_States
RWLock State.
Enumerator |
---|
CORE_RWLOCK_UNLOCKED | This indicates the the RWLock is not currently locked.
|
CORE_RWLOCK_LOCKED_FOR_READING | This indicates the the RWLock is currently locked for reading.
|
CORE_RWLOCK_LOCKED_FOR_WRITING | This indicates the the RWLock is currently locked for reading.
|
◆ _CORE_RWLock_Initialize()
Initializes a RWlock.
This routine initializes the RWLock.
- Parameters
-
[out] | the_rwlock | is the RWLock to initialize. |
◆ _CORE_RWLock_Seize_for_reading()
Obtains RWLock for reading.
This routine attempts to obtain the RWLock for read access.
- Parameters
-
[in,out] | the_rwlock | is the RWLock to wait for |
| wait | Indicates whether the calling thread is willing to wait. |
| queue_context | The thread queue context. |
- Return values
-
STATUS_SUCCESSFUL | The RWlock was successfully seized. |
STATUS_UNAVAILABLE | The RWlock is currently locked for writing and the calling thread is not willing to wait. |
STATUS_TIMEOUT | A timeout occurred. |
◆ _CORE_RWLock_Seize_for_writing()
Obtains RWLock for writing.
This routine attempts to obtain the RWLock for write exclusive access.
- Parameters
-
[in,out] | the_rwlock | The RWLock to wait for. |
| wait | Indicates whether the calling thread is willing to wait. |
| queue_context | The thread queue context. |
- Return values
-
STATUS_SUCCESSFUL | The RWLock was successfully obtained for write exclusive access. |
STATUS_UNAVAILABLE | The RWlock is currently locked and the calling thread is not willing to wait. |
STATUS_TIMEOUT | A timeout occurred. |
◆ _CORE_RWLock_Surrender()
Releases the RWLock.
This routine manually releases the_rwlock. All of the threads waiting for the RWLock will be readied.
- Parameters
-
[in,out] | the_rwlock | The RWLock to surrender. |
- Returns
- STATUS_SUCCESSFUL This method is always successful.