summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/coremutexsurrender.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-24 15:33:34 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-03-29 09:38:48 +0200
commit7a904cbe5e06a32eb7ccc7b1a28a86319df09a98 (patch)
tree4b756a6622785671260bbee9abc7c87cc74ed7e4 /cpukit/score/src/coremutexsurrender.c
parentsamples/base_mp: Check directive status (diff)
downloadrtems-7a904cbe5e06a32eb7ccc7b1a28a86319df09a98.tar.bz2
score: Fix CORE mutex RTEMS_MULTIPROCESSING
Make sure that the thread proxy is registered as the mutex owner.
Diffstat (limited to '')
-rw-r--r--cpukit/score/src/coremutexsurrender.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/cpukit/score/src/coremutexsurrender.c b/cpukit/score/src/coremutexsurrender.c
index 744adc5eb8..da21d4bfea 100644
--- a/cpukit/score/src/coremutexsurrender.c
+++ b/cpukit/score/src/coremutexsurrender.c
@@ -187,6 +187,9 @@ CORE_mutex_Status _CORE_mutex_Surrender(
) {
bool unblock;
+ the_mutex->holder = the_thread;
+ the_mutex->nest_count = 1;
+
/*
* We must extract the thread now since this will restore its default
* thread lock. This is necessary to avoid a deadlock in the
@@ -205,9 +208,6 @@ CORE_mutex_Status _CORE_mutex_Surrender(
if ( _Objects_Is_local_id( the_thread->Object.id ) )
#endif
{
- the_mutex->holder = the_thread;
- the_mutex->nest_count = 1;
-
switch ( the_mutex->Attributes.discipline ) {
case CORE_MUTEX_DISCIPLINES_FIFO:
case CORE_MUTEX_DISCIPLINES_PRIORITY:
@@ -237,12 +237,7 @@ CORE_mutex_Status _CORE_mutex_Surrender(
#if defined(RTEMS_MULTIPROCESSING)
if ( !_Objects_Is_local_id( the_thread->Object.id ) ) {
-
- the_mutex->holder = NULL;
- the_mutex->nest_count = 1;
-
( *api_mutex_mp_support)( the_thread, id );
-
}
_Thread_Dispatch_enable( _Per_CPU_Get() );