RTEMS
5.1
|
ScoreRWLock. More...
Files | |
file | corerwlockimpl.h |
Inlined Routines Associated with the SuperCore RWLock. | |
file | corerwlock.c |
file | corerwlockobtainread.c |
Obtain RWLock for reading. | |
file | corerwlockobtainwrite.c |
RWLock Obtain for Writing. | |
file | corerwlockrelease.c |
Releases the RWLock. | |
Data Structures | |
struct | CORE_RWLock_Control |
Macros | |
#define | CORE_RWLOCK_TQ_OPERATIONS &_Thread_queue_Operations_FIFO |
#define | CORE_RWLOCK_THREAD_WAITING_FOR_READ 0 |
#define | CORE_RWLOCK_THREAD_WAITING_FOR_WRITE 1 |
Enumerations | |
enum | CORE_RWLock_States { CORE_RWLOCK_UNLOCKED, CORE_RWLOCK_LOCKED_FOR_READING, CORE_RWLOCK_LOCKED_FOR_WRITING } |
Functions | |
void | _CORE_RWLock_Initialize (CORE_RWLock_Control *the_rwlock) |
Initializes a RWlock. More... | |
RTEMS_INLINE_ROUTINE void | _CORE_RWLock_Destroy (CORE_RWLock_Control *the_rwlock) |
Destroys a RWlock. More... | |
RTEMS_INLINE_ROUTINE Thread_Control * | _CORE_RWLock_Acquire (CORE_RWLock_Control *the_rwlock, Thread_queue_Context *queue_context) |
Acquires the RWlock. More... | |
RTEMS_INLINE_ROUTINE void | _CORE_RWLock_Release (CORE_RWLock_Control *the_rwlock, Thread_queue_Context *queue_context) |
Releases the RWlock. More... | |
Status_Control | _CORE_RWLock_Seize_for_reading (CORE_RWLock_Control *the_rwlock, bool wait, Thread_queue_Context *queue_context) |
Obtains RWLock for reading. More... | |
Status_Control | _CORE_RWLock_Seize_for_writing (CORE_RWLock_Control *the_rwlock, bool wait, Thread_queue_Context *queue_context) |
Obtains RWLock for writing. More... | |
Status_Control | _CORE_RWLock_Surrender (CORE_RWLock_Control *the_rwlock) |
Releases the RWLock. More... | |
ScoreRWLock.
#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.
#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.
enum CORE_RWLock_States |
RTEMS_INLINE_ROUTINE Thread_Control* _CORE_RWLock_Acquire | ( | CORE_RWLock_Control * | the_rwlock, |
Thread_queue_Context * | queue_context | ||
) |
Acquires the RWlock.
[in,out] | the_rwlock | The RWlock to acquire. |
queue_context | The thread queue context. |
RTEMS_INLINE_ROUTINE void _CORE_RWLock_Destroy | ( | CORE_RWLock_Control * | the_rwlock | ) |
Destroys a RWlock.
This routine destroys the RWLock.
[out] | the_rwlock | is the RWLock to destroy. |
void _CORE_RWLock_Initialize | ( | CORE_RWLock_Control * | the_rwlock | ) |
Initializes a RWlock.
This routine initializes the RWLock.
[out] | the_rwlock | is the RWLock to initialize. |
RTEMS_INLINE_ROUTINE void _CORE_RWLock_Release | ( | CORE_RWLock_Control * | the_rwlock, |
Thread_queue_Context * | queue_context | ||
) |
Releases the RWlock.
[in,out] | the_rwlock | The RWlock to release. |
queue_context | The thread queue context. |
Status_Control _CORE_RWLock_Seize_for_reading | ( | CORE_RWLock_Control * | the_rwlock, |
bool | wait, | ||
Thread_queue_Context * | queue_context | ||
) |
Obtains RWLock for reading.
This routine attempts to obtain the RWLock for read access.
[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. |
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 occured. |
Status_Control _CORE_RWLock_Seize_for_writing | ( | CORE_RWLock_Control * | the_rwlock, |
bool | wait, | ||
Thread_queue_Context * | queue_context | ||
) |
Obtains RWLock for writing.
This routine attempts to obtain the RWLock for write exclusive access.
[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. |
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. |
Status_Control _CORE_RWLock_Surrender | ( | CORE_RWLock_Control * | the_rwlock | ) |
Releases the RWLock.
This routine manually releases the_rwlock. All of the threads waiting for the RWLock will be readied.
[in,out] | the_rwlock | The RWLock to surrender. |