RTEMS
|
Mutex Handler. More...
Files | |
file | coremutex.h |
CORE Mutex API. | |
file | coremuteximpl.h |
CORE Mutex Implementation. | |
file | coremutexseize.c |
Seize Mutex with Blocking. | |
Classes | |
struct | CORE_mutex_Control |
Control block used to manage each mutex. More... | |
struct | CORE_recursive_mutex_Control |
The recursive mutex control. More... | |
struct | CORE_ceiling_mutex_Control |
The recursive mutex control with priority ceiling protocol support. More... | |
Macros | |
#define | CORE_MUTEX_TQ_OPERATIONS &_Thread_queue_Operations_priority |
#define | CORE_MUTEX_TQ_PRIORITY_INHERIT_OPERATIONS &_Thread_queue_Operations_priority_inherit |
Functions | |
static __inline__ void | _CORE_mutex_Initialize (CORE_mutex_Control *the_mutex) |
Initializes the mutex. More... | |
static __inline__ void | _CORE_mutex_Destroy (CORE_mutex_Control *the_mutex) |
Destroys the mutex. More... | |
static __inline__ void | _CORE_mutex_Acquire_critical (CORE_mutex_Control *the_mutex, Thread_queue_Context *queue_context) |
Acquires the mutex critical. More... | |
static __inline__ void | _CORE_mutex_Release (CORE_mutex_Control *the_mutex, Thread_queue_Context *queue_context) |
Releases the mutex. More... | |
static __inline__ Thread_Control * | _CORE_mutex_Get_owner (const CORE_mutex_Control *the_mutex) |
Gets the owner of the mutex. More... | |
static __inline__ bool | _CORE_mutex_Is_locked (const CORE_mutex_Control *the_mutex) |
Checks if the mutex is locked. More... | |
Status_Control | _CORE_mutex_Seize_slow (CORE_mutex_Control *the_mutex, const Thread_queue_Operations *operations, Thread_Control *executing, bool wait, Thread_queue_Context *queue_context) |
Seize the mutex slowly. More... | |
static __inline__ void | _CORE_mutex_Set_owner (CORE_mutex_Control *the_mutex, Thread_Control *owner) |
Sets the owner of the mutex. More... | |
static __inline__ bool | _CORE_mutex_Is_owner (const CORE_mutex_Control *the_mutex, const Thread_Control *the_thread) |
Checks if the the thread is the owner of the mutex. More... | |
static __inline__ void | _CORE_recursive_mutex_Initialize (CORE_recursive_mutex_Control *the_mutex) |
Initializes a recursive mutex. More... | |
static __inline__ Status_Control | _CORE_recursive_mutex_Seize_nested (CORE_recursive_mutex_Control *the_mutex) |
Seizes the recursive mutex nested. More... | |
static __inline__ Status_Control | _CORE_recursive_mutex_Seize (CORE_recursive_mutex_Control *the_mutex, const Thread_queue_Operations *operations, Thread_Control *executing, bool wait, Status_Control(*nested)(CORE_recursive_mutex_Control *), Thread_queue_Context *queue_context) |
Seizes the recursive mutex. More... | |
static __inline__ Status_Control | _CORE_recursive_mutex_Surrender (CORE_recursive_mutex_Control *the_mutex, const Thread_queue_Operations *operations, Thread_Control *executing, Thread_queue_Context *queue_context) |
Surrenders the recursive mutex. More... | |
static __inline__ void | _CORE_ceiling_mutex_Initialize (CORE_ceiling_mutex_Control *the_mutex, const Scheduler_Control *scheduler, Priority_Control priority_ceiling) |
initializes a ceiling mutex. More... | |
static __inline__ const Scheduler_Control * | _CORE_ceiling_mutex_Get_scheduler (const CORE_ceiling_mutex_Control *the_mutex) |
Gets the scheduler of the ceiling mutex. More... | |
static __inline__ void | _CORE_ceiling_mutex_Set_priority (CORE_ceiling_mutex_Control *the_mutex, Priority_Control priority_ceiling, Thread_queue_Context *queue_context) |
Sets the priority of the ceiling mutex. More... | |
static __inline__ Priority_Control | _CORE_ceiling_mutex_Get_priority (const CORE_ceiling_mutex_Control *the_mutex) |
Gets the priority of the ceiling mutex. More... | |
static __inline__ Status_Control | _CORE_ceiling_mutex_Set_owner (CORE_ceiling_mutex_Control *the_mutex, Thread_Control *owner, Thread_queue_Context *queue_context) |
Sets the owner of the ceiling mutex. More... | |
static __inline__ Status_Control | _CORE_ceiling_mutex_Seize (CORE_ceiling_mutex_Control *the_mutex, Thread_Control *executing, bool wait, Status_Control(*nested)(CORE_recursive_mutex_Control *), Thread_queue_Context *queue_context) |
Seizes the ceiling mutex. More... | |
static __inline__ Status_Control | _CORE_ceiling_mutex_Surrender (CORE_ceiling_mutex_Control *the_mutex, Thread_Control *executing, Thread_queue_Context *queue_context) |
Surrenders the ceiling mutex. More... | |
Mutex Handler.
This handler encapsulates functionality which provides the foundation Mutex services used in all of the APIs supported by RTEMS.
|
static |
Gets the priority of the ceiling mutex.
the_mutex | The mutex to get the priority from. |
Definition at line 393 of file coremuteximpl.h.
|
static |
Gets the scheduler of the ceiling mutex.
the_mutex | The ceiling mutex to get the scheduler from. |
Definition at line 343 of file coremuteximpl.h.
|
static |
initializes a ceiling mutex.
[out] | the_mutex | The ceiling mutex to initialize. |
scheduler | The scheduler for the new ceiling mutex. Only needed if RTEMS_SMP is defined | |
priority_ceiling | The priority ceiling for the initialized mutex. |
Definition at line 322 of file coremuteximpl.h.
|
static |
Seizes the ceiling mutex.
[in,out] | the_mutex | The mutex to seize. |
executing | The executing thread. | |
wait | Indicates whether the calling thread is willing to wait. | |
nested | Function that returns the status of the recursive mutex | |
queue_context | The thread queue context. |
STATUS_SUCCESSFUL | The owner of the mutex was changed successfully. |
STATUS_NOT_DEFINED | If the scheduler of the executing thread is not equal to the owner of the_mutex . |
STATUS_MUTEX_CEILING_VIOLATED | The owners wait priority is smaller than the priority of the ceiling mutex. |
other | Return value of nested. |
Definition at line 465 of file coremuteximpl.h.
|
static |
Sets the owner of the ceiling mutex.
[in,out] | the_mutex | The mutex to set the owner of. |
owner | The new owner of the_mutex. | |
queue_context | The thread queue context. |
STATUS_SUCCESSFUL | The owner of the mutex was changed successfully. |
STATUS_MUTEX_CEILING_VIOLATED | The owners wait priority is smaller than the priority of the ceiling mutex. |
Definition at line 411 of file coremuteximpl.h.
|
static |
Sets the priority of the ceiling mutex.
[out] | the_mutex | The ceiling mutex to set the priority of. |
priority_ceiling | The new priority ceiling of the mutex. | |
queue_context | The thread queue context. |
Definition at line 361 of file coremuteximpl.h.
|
static |
Surrenders the ceiling mutex.
[in,out] | the_mutex | The ceiling mutex to surrender. |
executing | The executing thread. | |
queue_context | The thread queue context. |
STATUS_SUCCESSFUL | The ceiling mutex was successfullysurrendered. |
STATUS_NOT_OWNER | The executing thread is not the owner of the_mutex. |
Definition at line 525 of file coremuteximpl.h.
|
static |
Acquires the mutex critical.
[in,out] | the_mutex | The mutex to acquire critical. |
queue_context | The queue context. |
Definition at line 71 of file coremuteximpl.h.
|
static |
Destroys the mutex.
[out] | the_mutex | the mutex to destroy. |
Definition at line 60 of file coremuteximpl.h.
|
static |
Gets the owner of the mutex.
the_mutex | The mutex to get the owner from. |
Definition at line 100 of file coremuteximpl.h.
|
static |
Initializes the mutex.
[out] | the_mutex | The mutex to initialize. |
Definition at line 48 of file coremuteximpl.h.
|
static |
Checks if the mutex is locked.
This routine returns true if the specified mutex is locked and false otherwise.
the_mutex | The mutex to check if it is locked. |
true | The mutex is locked. |
false | The mutex is not locked. |
Definition at line 118 of file coremuteximpl.h.
|
static |
Checks if the the thread is the owner of the mutex.
the_mutex | The mutex to check the owner of. |
the_thread | The thread to check if it is the owner of the_mutex. |
true | the_thread is the owner of the_mutex. |
false | the_thread is not the owner of the_mutex. |
Definition at line 168 of file coremuteximpl.h.
|
static |
Releases the mutex.
[in,out] | the_mutex | The mutex to release. |
queue_context | The queue context. |
Definition at line 85 of file coremuteximpl.h.
Status_Control _CORE_mutex_Seize_slow | ( | CORE_mutex_Control * | the_mutex, |
const Thread_queue_Operations * | operations, | ||
Thread_Control * | executing, | ||
bool | wait, | ||
Thread_queue_Context * | queue_context | ||
) |
Seize the mutex slowly.
[in,out] | the_mutex | The mutex to seize. |
operations | The thread queue operations. | |
executing | The calling thread. | |
wait | Indicates whether the calling thread is willing to wait. | |
queue_context | The thread queue context. |
_Thread_Wait_get_status | The status of the executing thread. |
STATUS_UNAVAILABLE | The calling thread is not willing to wait. |
Definition at line 26 of file coremutexseize.c.
|
static |
Sets the owner of the mutex.
[out] | the_mutex | The mutex to set the owner from. |
owner | The new owner of the mutex. |
Definition at line 151 of file coremuteximpl.h.
|
static |
Initializes a recursive mutex.
[out] | the_mutex | The recursive mutex to initialize. |
Definition at line 181 of file coremuteximpl.h.
|
static |
Seizes the recursive mutex.
[in,out] | the_mutex | The recursive mutex to seize. |
operations | The thread queue operations. | |
[out] | executing | The executing thread. |
wait | Indicates whether the calling thread is willing to wait. | |
nested | Returns the status of a recursive mutex. | |
queue_context | The thread queue context. |
STATUS_SUCCESSFUL | The owner of the mutex was NULL, successful seizing of the mutex. |
_Thread_Wait_get_status | The status of the executing thread. |
STATUS_UNAVAILABLE | The calling thread is not willing to wait. |
Definition at line 219 of file coremuteximpl.h.
|
static |
Seizes the recursive mutex nested.
[out] | the_mutex | The recursive mutex to seize nested. |
Definition at line 196 of file coremuteximpl.h.
|
static |
Surrenders the recursive mutex.
[in,out] | the_mutex | The recursive mutex to surrender. |
operations | The thread queue operations. | |
executing | The executing thread. | |
queue_context | the thread queue context. |
STATUS_SUCCESSFUL | the_mutex is successfully surrendered. |
STATUS_NOT_OWNER | The executing thread does not own the_mutex. |
Definition at line 269 of file coremuteximpl.h.