summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/apimutexunlock.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-12 16:32:27 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-20 07:49:37 +0200
commit9949d8a7d042da7ba53516300db5c34c8b9c8a31 (patch)
tree614aded79bd69e1134dc1b83711b0636ca8e044d /cpukit/score/src/apimutexunlock.c
parentscore: Delete unused variable (diff)
downloadrtems-9949d8a7d042da7ba53516300db5c34c8b9c8a31.tar.bz2
score: Add Thread_Change_life()
Add _Thread_Change_life_locked() as a general function to alter the thread life state. Use it to implement _Thread_Set_life_protection() as a first step. Update #2555. Update #2626.
Diffstat (limited to 'cpukit/score/src/apimutexunlock.c')
-rw-r--r--cpukit/score/src/apimutexunlock.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/cpukit/score/src/apimutexunlock.c b/cpukit/score/src/apimutexunlock.c
index 3545377b43..e129dd2091 100644
--- a/cpukit/score/src/apimutexunlock.c
+++ b/cpukit/score/src/apimutexunlock.c
@@ -24,12 +24,11 @@
void _API_Mutex_Unlock( API_Mutex_Control *the_mutex )
{
- ISR_lock_Context lock_context;
- bool previous_thread_life_protection;
- bool restore_thread_life_protection;
+ ISR_lock_Context lock_context;
+ Thread_Life_state previous_thread_life_state;
+ bool restore_thread_life_protection;
- previous_thread_life_protection =
- the_mutex->previous_thread_life_protection;
+ previous_thread_life_state = the_mutex->previous_thread_life_state;
restore_thread_life_protection = the_mutex->Mutex.nest_count == 1;
_ISR_lock_ISR_disable( &lock_context );
@@ -41,6 +40,6 @@ void _API_Mutex_Unlock( API_Mutex_Control *the_mutex )
);
if ( restore_thread_life_protection ) {
- _Thread_Set_life_protection( previous_thread_life_protection );
+ _Thread_Set_life_protection( previous_thread_life_state );
}
}