diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-27 08:02:03 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-05-30 16:16:23 +0200 |
commit | 5a598ac99b0de720a04afc5e2ac6764117589b90 (patch) | |
tree | 811d57df33c0f4fcc1cce61095cb5c0a33eadd7c /cpukit/score/include/rtems/score/coremutex.h | |
parent | posix: Delete POSIX_Mutex_Protocol::process_shared (diff) | |
download | rtems-5a598ac99b0de720a04afc5e2ac6764117589b90.tar.bz2 |
score: Add CORE mutex variants
Add CORE_recursive_mutex_Control and CORE_ceiling_mutex_Control to avoid
the run-time evaluation of attributes to figure out how a particular
mutex methods should behave. Start with the no protocol variants. This
eliminates the CORE_MUTEX_DISCIPLINES_FIFO and
CORE_MUTEX_DISCIPLINES_PRIORITY disciplines.
Diffstat (limited to 'cpukit/score/include/rtems/score/coremutex.h')
-rw-r--r-- | cpukit/score/include/rtems/score/coremutex.h | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/cpukit/score/include/rtems/score/coremutex.h b/cpukit/score/include/rtems/score/coremutex.h index f8694095ac..173bb2efa6 100644 --- a/cpukit/score/include/rtems/score/coremutex.h +++ b/cpukit/score/include/rtems/score/coremutex.h @@ -47,10 +47,6 @@ extern "C" { * This enumerated type defines the blocking disciplines for a mutex. */ typedef enum { - /** This specifies that threads will wait for the mutex in FIFO order. */ - CORE_MUTEX_DISCIPLINES_FIFO, - /** This specifies that threads will wait for the mutex in priority order. */ - CORE_MUTEX_DISCIPLINES_PRIORITY, /** This specifies that threads will wait for the mutex in priority order. * Additionally, the Priority Inheritance Protocol will be in effect. */ @@ -100,10 +96,6 @@ typedef struct { * be when attempting to acquire the mutex when it is already locked. */ CORE_mutex_Nesting_behaviors lock_nesting_behavior; - /** When this field is true, then only the thread that locked the mutex - * is allowed to unlock it. - */ - bool only_owner_release; /** This field indicates whether threads waiting on the mutex block in * FIFO or priority order. */ @@ -125,11 +117,6 @@ typedef struct { */ Thread_queue_Control Wait_queue; - /** - * @brief The thread queue operations according to the blocking discipline. - */ - const Thread_queue_Operations *operations; - /** This element is the set of attributes which define this instance's * behavior. */ @@ -145,6 +132,36 @@ typedef struct { Thread_Control *holder; } CORE_mutex_Control; +/** + * @brief The recursive mutex control. + */ +typedef struct { + /** + * @brief The plain non-recursive mutex. + */ + CORE_mutex_Control Mutex; + + /** + * @brief The nest level in case of a recursive seize. + */ + unsigned int nest_level; +} CORE_recursive_mutex_Control; + +/** + * @brief The recursive mutex control with priority ceiling protocol support. + */ +typedef struct { + /** + * @brief The plain recursive mutex. + */ + CORE_recursive_mutex_Control Recursive; + + /** + * @brief The priority ceiling value for the mutex owner. + */ + Priority_Control priority_ceiling; +} CORE_ceiling_mutex_Control; + /**@}*/ #ifdef __cplusplus |