summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/apimutexunlock.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-02 14:27:24 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-19 12:00:47 +0200
commit4438ac2575fb9e0760bf53931a52d00dec4deb83 (patch)
tree1a81aa76215e781bdddd08a92f4be01454d330ae /cpukit/score/src/apimutexunlock.c
parentscore: Inline _CORE_semaphore_Surrender() (diff)
downloadrtems-4438ac2575fb9e0760bf53931a52d00dec4deb83.tar.bz2
score: Fine grained locking for mutexes
Update #2273.
Diffstat (limited to 'cpukit/score/src/apimutexunlock.c')
-rw-r--r--cpukit/score/src/apimutexunlock.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/cpukit/score/src/apimutexunlock.c b/cpukit/score/src/apimutexunlock.c
index d0432a6f4a..04657ddcec 100644
--- a/cpukit/score/src/apimutexunlock.c
+++ b/cpukit/score/src/apimutexunlock.c
@@ -24,18 +24,21 @@
void _API_Mutex_Unlock( API_Mutex_Control *the_mutex )
{
- bool previous_thread_life_protection;
- bool restore_thread_life_protection;
-
- _Thread_Disable_dispatch();
+ ISR_lock_Context lock_context;
+ bool previous_thread_life_protection;
+ bool restore_thread_life_protection;
previous_thread_life_protection =
the_mutex->previous_thread_life_protection;
restore_thread_life_protection = the_mutex->Mutex.nest_count == 1;
- _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, NULL );
-
- _Thread_Enable_dispatch();
+ _ISR_lock_ISR_disable( &lock_context );
+ _CORE_mutex_Surrender(
+ &the_mutex->Mutex,
+ the_mutex->Object.id,
+ NULL,
+ &lock_context
+ );
if ( restore_thread_life_protection ) {
_Thread_Set_life_protection( previous_thread_life_protection );