summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-27 14:46:31 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2014-03-31 10:14:42 +0200
commit03e8928753ef76cb747b965938092c59d6306060 (patch)
treeb97520d3bd562dc50a226b590d8626f2b4e85d19 /cpukit/score/src
parentscore: Delete CORE_mutex_Control::holder_id (diff)
downloadrtems-03e8928753ef76cb747b965938092c59d6306060.tar.bz2
score: Delete CORE_mutex_Control::lock
The holder field is enough to determine if a mutex is locked or not. This leads also to better error status codes in case a rtems_semaphore_release() is done for a mutex without having the ownership.
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/apimutex.c2
-rw-r--r--cpukit/score/src/coremutex.c5
-rw-r--r--cpukit/score/src/coremutexsurrender.c3
3 files changed, 4 insertions, 6 deletions
diff --git a/cpukit/score/src/apimutex.c b/cpukit/score/src/apimutex.c
index 7899934183..ec2fbdc3ec 100644
--- a/cpukit/score/src/apimutex.c
+++ b/cpukit/score/src/apimutex.c
@@ -61,7 +61,7 @@ void _API_Mutex_Allocate(
mutex = (API_Mutex_Control *)
_Objects_Allocate_unprotected( &_API_Mutex_Information );
- _CORE_mutex_Initialize( &mutex->Mutex, NULL, &attr, CORE_MUTEX_UNLOCKED );
+ _CORE_mutex_Initialize( &mutex->Mutex, NULL, &attr, false );
_Objects_Open_u32( &_API_Mutex_Information, &mutex->Object, 1 );
diff --git a/cpukit/score/src/coremutex.c b/cpukit/score/src/coremutex.c
index 1c6c3db302..96b11c9cd1 100644
--- a/cpukit/score/src/coremutex.c
+++ b/cpukit/score/src/coremutex.c
@@ -27,7 +27,7 @@ CORE_mutex_Status _CORE_mutex_Initialize(
CORE_mutex_Control *the_mutex,
Thread_Control *executing,
const CORE_mutex_Attributes *the_mutex_attributes,
- uint32_t initial_lock
+ bool initially_locked
)
{
@@ -37,9 +37,8 @@ CORE_mutex_Status _CORE_mutex_Initialize(
*/
the_mutex->Attributes = *the_mutex_attributes;
- the_mutex->lock = initial_lock;
- if ( initial_lock == CORE_MUTEX_LOCKED ) {
+ if ( initially_locked ) {
the_mutex->nest_count = 1;
the_mutex->holder = executing;
if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ||
diff --git a/cpukit/score/src/coremutexsurrender.c b/cpukit/score/src/coremutexsurrender.c
index de1c744c2c..fff3cd74da 100644
--- a/cpukit/score/src/coremutexsurrender.c
+++ b/cpukit/score/src/coremutexsurrender.c
@@ -217,8 +217,7 @@ CORE_mutex_Status _CORE_mutex_Surrender(
break;
}
}
- } else
- the_mutex->lock = CORE_MUTEX_UNLOCKED;
+ }
return CORE_MUTEX_STATUS_SUCCESSFUL;
}