RTEMS CPU Kit with SuperCore  4.11.2
coremutex.h
Go to the documentation of this file.
1 
12 /*
13  * COPYRIGHT (c) 1989-2011.
14  * On-Line Applications Research Corporation (OAR).
15  *
16  * The license and distribution terms for this file may be
17  * found in the file LICENSE in this distribution or at
18  * http://www.rtems.org/license/LICENSE.
19  */
20 
21 #ifndef _RTEMS_SCORE_COREMUTEX_H
22 #define _RTEMS_SCORE_COREMUTEX_H
23 
24 #include <rtems/score/thread.h>
25 #include <rtems/score/threadq.h>
26 #include <rtems/score/priority.h>
27 #include <rtems/score/watchdog.h>
28 #include <rtems/score/interr.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
49 typedef enum {
63 
70 typedef enum {
80 #if defined(RTEMS_POSIX_API)
81 
88  CORE_MUTEX_NESTING_IS_ERROR,
89 #endif
90 
98 
105 typedef struct {
109  CORE_mutex_Nesting_behaviors lock_nesting_behavior;
117  CORE_mutex_Disciplines discipline;
123 
124 #ifdef __RTEMS_STRICT_ORDER_MUTEX__
125 
131  typedef struct{
136  Chain_Node lock_queue;
140  Priority_Control priority_before;
141  } CORE_mutex_order_list;
142 #endif
143 
149 typedef struct {
161  uint32_t nest_count;
167 #ifdef __RTEMS_STRICT_ORDER_MUTEX__
168 
169  CORE_mutex_order_list queue;
170 #endif
171 
173 
176 #ifdef __cplusplus
177 }
178 #endif
179 
180 #endif
181 /* end of include file */
Constants and Prototypes Related to the Internal Error Handler.
CORE_mutex_Nesting_behaviors lock_nesting_behavior
This field determines what the behavior of this mutex instance will be when attempting to acquire the...
Definition: coremutex.h:109
Thread Priority Manipulation Routines.
This is used to manage each element (node) which is placed on a chain.
Definition: chain.h:65
Thread_queue_Control Wait_queue
This field is the Waiting Queue used to manage the set of tasks which are blocked waiting to lock the...
Definition: coremutex.h:153
This specifies that threads will wait for the mutex in priority order.
Definition: coremutex.h:53
Priority_Control priority_ceiling
This field contains the ceiling priority to be used if that protocol is selected. ...
Definition: coremutex.h:121
This specifies that threads will wait for the mutex in FIFO order.
Definition: coremutex.h:51
CORE_mutex_Nesting_behaviors
The possible behaviors for lock nesting.
Definition: coremutex.h:70
This is the structure used to manage sets of tasks which are blocked waiting to acquire a resource...
Definition: threadq.h:171
uint32_t nest_count
This element contains the number of times the mutex has been acquired nested.
Definition: coremutex.h:161
Constants and Structures Associated with Watchdog Timers.
Constants and Structures Needed to Declare a Thread Queue.
This specifies that threads will wait for the mutex in priority order.
Definition: coremutex.h:61
Constants and Structures Related with the Thread Control Block.
uint32_t Priority_Control
The following type defines the control block used to manage thread priorities.
Definition: priority.h:56
bool only_owner_release
When this field is true, then only the thread that locked the mutex is allowed to unlock it...
Definition: coremutex.h:113
This structure defines the Thread Control Block (TCB).
Definition: thread.h:671
This specifies that threads will wait for the mutex in priority order.
Definition: coremutex.h:57
Control block used to manage each mutex.
Definition: coremutex.h:149
This sequence performs as indicated:
Definition: coremutex.h:96
This sequence has no blocking or errors:
Definition: coremutex.h:79
Thread_Control * holder
This element points to the thread which is currently holding this mutex.
Definition: coremutex.h:166
The control block used to manage attributes of each mutex.
Definition: coremutex.h:105
CORE_mutex_Attributes Attributes
This element is the set of attributes which define this instance&#39;s behavior.
Definition: coremutex.h:157
CORE_mutex_Disciplines
The blocking disciplines for a mutex.
Definition: coremutex.h:49
CORE_mutex_Disciplines discipline
This field indicates whether threads waiting on the mutex block in FIFO or priority order...
Definition: coremutex.h:117