summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/coremutexseize.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-27 08:02:03 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-30 16:16:23 +0200
commit5a598ac99b0de720a04afc5e2ac6764117589b90 (patch)
tree811d57df33c0f4fcc1cce61095cb5c0a33eadd7c /cpukit/score/src/coremutexseize.c
parentposix: Delete POSIX_Mutex_Protocol::process_shared (diff)
downloadrtems-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/src/coremutexseize.c')
-rw-r--r--cpukit/score/src/coremutexseize.c27
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;
+ }
+}