From 4438ac2575fb9e0760bf53931a52d00dec4deb83 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Sat, 2 May 2015 14:27:24 +0200 Subject: score: Fine grained locking for mutexes Update #2273. --- cpukit/posix/src/mutexunlock.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'cpukit/posix/src/mutexunlock.c') diff --git a/cpukit/posix/src/mutexunlock.c b/cpukit/posix/src/mutexunlock.c index dbb9d1a3e6..c5b2375d1a 100644 --- a/cpukit/posix/src/mutexunlock.c +++ b/cpukit/posix/src/mutexunlock.c @@ -41,17 +41,22 @@ int pthread_mutex_unlock( register POSIX_Mutex_Control *the_mutex; Objects_Locations location; CORE_mutex_Status status; + ISR_lock_Context lock_context; - the_mutex = _POSIX_Mutex_Get( mutex, &location ); + the_mutex = _POSIX_Mutex_Get_interrupt_disable( + mutex, + &location, + &lock_context + ); switch ( location ) { case OBJECTS_LOCAL: status = _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, - NULL + NULL, + &lock_context ); - _Objects_Put( &the_mutex->Object ); return _POSIX_Mutex_Translate_core_mutex_return_code( status ); #if defined(RTEMS_MULTIPROCESSING) -- cgit v1.2.3