PinCRT
Functions
Readers writers lock

Functions

void OS_RWLockInitialize (volatile OS_APIS_RW_LOCK_T *l)
 
void OS_RWLockDestroy (volatile OS_APIS_RW_LOCK_T *l)
 
void OS_RWLockAcquireWrite (volatile OS_APIS_RW_LOCK_T *lock)
 
void OS_RWLockReleaseWrite (volatile OS_APIS_RW_LOCK_T *lock)
 
void OS_RWLockAcquireRead (volatile OS_APIS_RW_LOCK_T *lock)
 
void OS_RWLockReleaseRead (volatile OS_APIS_RW_LOCK_T *lock)
 
BOOL_T OS_RWLockRelease (volatile OS_APIS_RW_LOCK_T *l)
 
BOOL_T OS_RWLockTryAcquireWrite (volatile OS_APIS_RW_LOCK_T *l)
 
BOOL_T OS_RWLockTryAcquireRead (volatile OS_APIS_RW_LOCK_T *l)
 

Detailed Description

Function Documentation

◆ OS_RWLockAcquireRead()

void OS_RWLockAcquireRead ( volatile OS_APIS_RW_LOCK_T *  lock)

Acquires the lock for reader. Blocks until the reader lock is acquired.

Parameters
[in]lockThe lock to acquire
Availability:
O/S: Windows, Linux & macOS*
CPU: All

◆ OS_RWLockAcquireWrite()

void OS_RWLockAcquireWrite ( volatile OS_APIS_RW_LOCK_T *  lock)

Acquires the lock for writer. Blocks until the writer lock is acquired.

Parameters
[in]lockThe lock to acquire
Availability:
O/S: Windows, Linux & macOS*
CPU: All

◆ OS_RWLockDestroy()

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]lockThe lock to destroy
Availability:
O/S: Windows, Linux & macOS*
CPU: All

◆ OS_RWLockInitialize()

void OS_RWLockInitialize ( volatile OS_APIS_RW_LOCK_T *  l)

Initializes a reader-writer lock.

Parameters
[in]lockThe lock to initialize
Availability:
O/S: Windows, Linux & macOS*
CPU: All

◆ OS_RWLockRelease()

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]lockThe 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

◆ OS_RWLockReleaseRead()

void OS_RWLockReleaseRead ( volatile OS_APIS_RW_LOCK_T *  lock)

Releases the lock for reader.

Parameters
[in]lockThe lock to release
Availability:
O/S: Windows, Linux & macOS*
CPU: All

◆ OS_RWLockReleaseWrite()

void OS_RWLockReleaseWrite ( volatile OS_APIS_RW_LOCK_T *  lock)

Releases the lock for writer.

Parameters
[in]lockThe lock to release
Availability:
O/S: Windows, Linux & macOS*
CPU: All

◆ OS_RWLockTryAcquireRead()

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]lockThe lock to acquire
Returns
TRUE If the reader lock was acquired.
Availability:
O/S: Windows, Linux & macOS*
CPU: All

◆ OS_RWLockTryAcquireWrite()

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]lockThe lock to acquire
Returns
TRUE If the writer lock was acquired.
Availability:
O/S: Windows, Linux & macOS*
CPU: All