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/src/coremutexseize.c | |
parent | bbb3c5f3314abb1c29cf2e467175a114b28a787d (diff) |
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/src/coremutexseize.c')
-rw-r--r-- | cpukit/score/src/coremutexseize.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/cpukit/score/src/coremutexseize.c b/cpukit/score/src/coremutexseize.c index 7b8b603d9b..596378fda6 100644 --- a/cpukit/score/src/coremutexseize.c +++ b/cpukit/score/src/coremutexseize.c @@ -68,7 +68,7 @@ Status_Control _CORE_mutex_Seize_interrupt_blocking( _Thread_queue_Enqueue_critical( &the_mutex->Wait_queue.Queue, - the_mutex->operations, + CORE_MUTEX_TQ_OPERATIONS, executing, STATES_WAITING_FOR_MUTEX, timeout, @@ -82,3 +82,28 @@ Status_Control _CORE_mutex_Seize_interrupt_blocking( return _Thread_Wait_get_status( executing ); } +Status_Control _CORE_mutex_Seize_no_protocol_slow( + CORE_mutex_Control *the_mutex, + const Thread_queue_Operations *operations, + Thread_Control *executing, + bool wait, + Watchdog_Interval timeout, + Thread_queue_Context *queue_context +) +{ + if ( wait ) { + _Thread_queue_Context_set_expected_level( queue_context, 1 ); + _Thread_queue_Enqueue_critical( + &the_mutex->Wait_queue.Queue, + operations, + executing, + STATES_WAITING_FOR_MUTEX, + timeout, + queue_context + ); + return _Thread_Wait_get_status( executing ); + } else { + _CORE_mutex_Release( the_mutex, queue_context ); + return STATUS_UNAVAILABLE; + } +} |