summaryrefslogtreecommitdiffstats
path: root/cpukit/score/include/rtems/score
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/include/rtems/score
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/include/rtems/score')
-rw-r--r--cpukit/score/include/rtems/score/apimutex.h2
-rw-r--r--cpukit/score/include/rtems/score/mrspimpl.h6
-rw-r--r--cpukit/score/include/rtems/score/threadimpl.h6
3 files changed, 7 insertions, 7 deletions
diff --git a/cpukit/score/include/rtems/score/apimutex.h b/cpukit/score/include/rtems/score/apimutex.h
index 86561aac74..1a4b1ee445 100644
--- a/cpukit/score/include/rtems/score/apimutex.h
+++ b/cpukit/score/include/rtems/score/apimutex.h
@@ -52,7 +52,7 @@ typedef struct {
* @brief The thread life protection state before the outer-most mutex
* obtain.
*/
- bool previous_thread_life_protection;
+ Thread_Life_state previous_thread_life_state;
} API_Mutex_Control;
/**
diff --git a/cpukit/score/include/rtems/score/mrspimpl.h b/cpukit/score/include/rtems/score/mrspimpl.h
index 1be320236a..f2570eb7fc 100644
--- a/cpukit/score/include/rtems/score/mrspimpl.h
+++ b/cpukit/score/include/rtems/score/mrspimpl.h
@@ -218,7 +218,7 @@ RTEMS_INLINE_ROUTINE MRSP_Status _MRSP_Wait_for_ownership(
{
MRSP_Status status;
MRSP_Rival rival;
- bool initial_life_protection;
+ Thread_Life_state life_state;
Per_CPU_Control *cpu_self;
ISR_lock_Context giant_lock_context;
ISR_Level level;
@@ -256,7 +256,7 @@ RTEMS_INLINE_ROUTINE MRSP_Status _MRSP_Wait_for_ownership(
_ISR_Enable_without_giant( level );
}
- initial_life_protection = _Thread_Set_life_protection( true );
+ life_state = _Thread_Set_life_protection( THREAD_LIFE_PROTECTED );
_Thread_Dispatch_enable( cpu_self );
_Assert( _Debug_Is_thread_dispatching_allowed() );
@@ -266,7 +266,7 @@ RTEMS_INLINE_ROUTINE MRSP_Status _MRSP_Wait_for_ownership(
status = rival.status;
} while ( status == MRSP_WAIT_FOR_OWNERSHIP );
- _Thread_Set_life_protection( initial_life_protection );
+ _Thread_Set_life_protection( life_state );
if ( timeout > 0 ) {
_ISR_Disable_without_giant( level );
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h
index be2095e023..e68f1191f8 100644
--- a/cpukit/score/include/rtems/score/threadimpl.h
+++ b/cpukit/score/include/rtems/score/threadimpl.h
@@ -198,7 +198,7 @@ bool _Thread_Restart(
void _Thread_Yield( Thread_Control *executing );
-bool _Thread_Set_life_protection( bool protect );
+Thread_Life_state _Thread_Set_life_protection( Thread_Life_state state );
/**
* @brief Kills all zombie threads in the system.
@@ -934,11 +934,11 @@ RTEMS_INLINE_ROUTINE bool _Thread_Is_life_terminating(
return ( life_state & THREAD_LIFE_TERMINATING ) != 0;
}
-RTEMS_INLINE_ROUTINE bool _Thread_Is_life_protected(
+RTEMS_INLINE_ROUTINE bool _Thread_Is_life_change_allowed(
Thread_Life_state life_state
)
{
- return ( life_state & THREAD_LIFE_PROTECTED ) != 0;
+ return ( life_state & THREAD_LIFE_PROTECTED ) == 0;
}
RTEMS_INLINE_ROUTINE bool _Thread_Is_life_changing(