Implementation of readers writers lock.
Function Documentation
void OS_RWLockAcquireRead |
( |
volatile OS_APIS_RW_LOCK_T * |
lock | ) |
|
Acquires the lock for reader. Blocks until the reader lock is acquired.
- Parameters:
-
[in] | lock | The lock to acquire |
- Availability:
- O/S: Windows, Linux & macOS*
CPU: All
void OS_RWLockAcquireWrite |
( |
volatile OS_APIS_RW_LOCK_T * |
lock | ) |
|
Acquires the lock for writer. Blocks until the writer lock is acquired.
- Parameters:
-
[in] | lock | The lock to acquire |
- Availability:
- O/S: Windows, Linux & macOS*
CPU: All
void OS_RWLockDestroy |
( |
volatile OS_APIS_RW_LOCK_T * |
l | ) |
|
Destroy a reader-writer lock, freeing all exhausted resources associated with the lock.
- Parameters:
-
[in] | lock | The lock to destroy |
- Availability:
- O/S: Windows, Linux & macOS*
CPU: All
void OS_RWLockInitialize |
( |
volatile OS_APIS_RW_LOCK_T * |
l | ) |
|
Initializes a reader-writer lock.
- Parameters:
-
[in] | lock | The lock to initialize |
- Availability:
- O/S: Windows, Linux & macOS*
CPU: All
BOOL_T OS_RWLockRelease |
( |
volatile OS_APIS_RW_LOCK_T * |
l | ) |
|
Releases the lock that was acquired. The lock kind that was acquired (whether its read or write) is determined by this function.
- Parameters:
-
[in] | lock | The lock to release |
- Returns:
- TRUE if the lock was taken (for either read or write) and as a result of this call is unlocked, FALSE otherwise. If the reader lock was released, and a waiting writer was woken up and acquired the lock, the function will return TRUE.
- Availability:
- O/S: Windows, Linux & macOS*
CPU: All
void OS_RWLockReleaseRead |
( |
volatile OS_APIS_RW_LOCK_T * |
lock | ) |
|
Releases the lock for reader.
- Parameters:
-
[in] | lock | The lock to release |
- Availability:
- O/S: Windows, Linux & macOS*
CPU: All
void OS_RWLockReleaseWrite |
( |
volatile OS_APIS_RW_LOCK_T * |
lock | ) |
|
Releases the lock for writer.
- Parameters:
-
[in] | lock | The lock to release |
- Availability:
- O/S: Windows, Linux & macOS*
CPU: All
BOOL_T OS_RWLockTryAcquireRead |
( |
volatile OS_APIS_RW_LOCK_T * |
l | ) |
|
Tries to Acquire the lock for reader. This function returns immediately if the lock can't be acquired.
- Parameters:
-
[in] | lock | The lock to acquire |
- Returns:
- TRUE If the reader lock was acquired.
- Availability:
- O/S: Windows, Linux & macOS*
CPU: All
BOOL_T OS_RWLockTryAcquireWrite |
( |
volatile OS_APIS_RW_LOCK_T * |
l | ) |
|
Tries to Acquire the lock for writer. This function returns immediately if the lock can't be acquired.
- Parameters:
-
[in] | lock | The lock to acquire |
- Returns:
- TRUE If the writer lock was acquired.
- Availability:
- O/S: Windows, Linux & macOS*
CPU: All