diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-05-02 14:27:24 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-05-19 12:00:47 +0200 |
commit | 4438ac2575fb9e0760bf53931a52d00dec4deb83 (patch) | |
tree | 1a81aa76215e781bdddd08a92f4be01454d330ae /cpukit/score/src/coremutex.c | |
parent | score: Inline _CORE_semaphore_Surrender() (diff) | |
download | rtems-4438ac2575fb9e0760bf53931a52d00dec4deb83.tar.bz2 |
score: Fine grained locking for mutexes
Update #2273.
Diffstat (limited to 'cpukit/score/src/coremutex.c')
-rw-r--r-- | cpukit/score/src/coremutex.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cpukit/score/src/coremutex.c b/cpukit/score/src/coremutex.c index 2f584f2abf..58c6c42b06 100644 --- a/cpukit/score/src/coremutex.c +++ b/cpukit/score/src/coremutex.c @@ -48,13 +48,14 @@ CORE_mutex_Status _CORE_mutex_Initialize( if ( is_priority_ceiling || _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) ) { Priority_Control ceiling = the_mutex->Attributes.priority_ceiling; + Per_CPU_Control *cpu_self; /* * The mutex initialization is only protected by the allocator lock in * general. Disable thread dispatching before the priority check to * prevent interference with priority inheritance. */ - _Thread_Disable_dispatch(); + cpu_self = _Thread_Dispatch_disable(); if ( is_priority_ceiling && executing->current_priority < ceiling ) { _Thread_Enable_dispatch(); @@ -73,7 +74,7 @@ CORE_mutex_Status _CORE_mutex_Initialize( _Thread_Change_priority( executing, ceiling, false ); } - _Thread_Enable_dispatch(); + _Thread_Dispatch_enable( cpu_self ); } } else { the_mutex->nest_count = 0; |