summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/apimutexunlock.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-11-29 06:23:27 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-12-04 10:53:39 +0100
commit6c2b8a4b35536a5f99ba1ef91139485b011dafc1 (patch)
treeb1ab330104094ec83051c932c4d5cb9e653a4568 /cpukit/score/src/apimutexunlock.c
parentada/sp09: Fix timer server test case (diff)
downloadrtems-6c2b8a4b35536a5f99ba1ef91139485b011dafc1.tar.bz2
score: Use self-contained API mutex
Use a self-contained recursive mutex for API_Mutex_Control. The API mutexes are protected against asynchronous thread cancellation. Add dedicated mutexes for libatomic and TOD. Close #2629. Close #2630.
Diffstat (limited to 'cpukit/score/src/apimutexunlock.c')
-rw-r--r--cpukit/score/src/apimutexunlock.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/cpukit/score/src/apimutexunlock.c b/cpukit/score/src/apimutexunlock.c
index e1fe6459d3..b4a5592059 100644
--- a/cpukit/score/src/apimutexunlock.c
+++ b/cpukit/score/src/apimutexunlock.c
@@ -20,25 +20,17 @@
#endif
#include <rtems/score/apimutex.h>
-#include <rtems/score/coremuteximpl.h>
+#include <rtems/score/threadimpl.h>
void _API_Mutex_Unlock( API_Mutex_Control *the_mutex )
{
- Thread_queue_Context queue_context;
- Thread_Life_state previous_thread_life_state;
- bool restore_thread_life_protection;
+ Thread_Life_state previous_thread_life_state;
+ bool restore_thread_life_protection;
previous_thread_life_state = the_mutex->previous_thread_life_state;
- restore_thread_life_protection = the_mutex->Mutex.nest_level == 0;
+ restore_thread_life_protection = the_mutex->Mutex._nest_level == 0;
- _Thread_queue_Context_initialize( &queue_context );
- _ISR_lock_ISR_disable( &queue_context.Lock_context.Lock_context );
- _CORE_recursive_mutex_Surrender(
- &the_mutex->Mutex,
- CORE_MUTEX_TQ_PRIORITY_INHERIT_OPERATIONS,
- _Thread_Executing,
- &queue_context
- );
+ _Mutex_recursive_Release( &the_mutex->Mutex );
if ( restore_thread_life_protection ) {
_Thread_Set_life_protection( previous_thread_life_state );