summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/coremutex.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-11 17:52:13 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-12 13:20:33 +0200
commit9276fdec2ec381e455e81f0fe3175d574579f631 (patch)
treed6efd1c75e93575a24b5125cb126140e411284e6 /cpukit/score/src/coremutex.c
parentRevert "score: Avoid use of uninitialized variable" (diff)
downloadrtems-9276fdec2ec381e455e81f0fe3175d574579f631.tar.bz2
score: Fix CORE mutex initialization
The priority inheritance and ceiling CORE mutexes wrongly used the FIFO queueing discipline. Delete misleading _CORE_mutex_Is_priority(). Bug introduced by 1e1a91ed11458ddbb27b94d0001d8f0fc2ef7a97. Add test sptests/spmutex01, since no existing uni-processor test covered the thread priority queueing discipline for CORE mutexes.
Diffstat (limited to 'cpukit/score/src/coremutex.c')
-rw-r--r--cpukit/score/src/coremutex.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cpukit/score/src/coremutex.c b/cpukit/score/src/coremutex.c
index 8fc3a406d9..ea5e759dc4 100644
--- a/cpukit/score/src/coremutex.c
+++ b/cpukit/score/src/coremutex.c
@@ -82,10 +82,10 @@ CORE_mutex_Status _CORE_mutex_Initialize(
_Thread_queue_Initialize( &the_mutex->Wait_queue );
- if ( _CORE_mutex_Is_priority( the_mutex_attributes ) ) {
- the_mutex->operations = &_Thread_queue_Operations_priority;
- } else {
+ if ( _CORE_mutex_Is_fifo( the_mutex_attributes ) ) {
the_mutex->operations = &_Thread_queue_Operations_FIFO;
+ } else {
+ the_mutex->operations = &_Thread_queue_Operations_priority;
}
return CORE_MUTEX_STATUS_SUCCESSFUL;