From 7a904cbe5e06a32eb7ccc7b1a28a86319df09a98 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Thu, 24 Mar 2016 15:33:34 +0100 Subject: score: Fix CORE mutex RTEMS_MULTIPROCESSING Make sure that the thread proxy is registered as the mutex owner. --- cpukit/score/src/coremutexsurrender.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'cpukit/score/src/coremutexsurrender.c') 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() ); -- cgit v1.2.3