diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-04-26 15:22:20 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-05-19 12:00:44 +0200 |
commit | b7cff7feb0a0d41ec4876e5ac846bb6cf8254dce (patch) | |
tree | 6fefc9247636f7619ca170e2189e06d7fec59e10 /cpukit | |
parent | Filesystem: Thread life protection for env changes (diff) | |
download | rtems-b7cff7feb0a0d41ec4876e5ac846bb6cf8254dce.tar.bz2 |
score: Reduce thread wait states
Merge THREAD_WAIT_STATE_SATISFIED, THREAD_WAIT_STATE_TIMEOUT,
THREAD_WAIT_STATE_INTERRUPT_SATISFIED, and
THREAD_WAIT_STATE_INTERRUPT_TIMEOUT into one state
THREAD_WAIT_STATE_READY_AGAIN. This helps to write generic routines to
block a thread.
Update #2273.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/rtems/src/eventsurrender.c | 4 | ||||
-rw-r--r-- | cpukit/rtems/src/eventtimeout.c | 4 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/thread.h | 7 | ||||
-rw-r--r-- | cpukit/score/include/rtems/score/threadimpl.h | 25 |
4 files changed, 10 insertions, 30 deletions
diff --git a/cpukit/rtems/src/eventsurrender.c b/cpukit/rtems/src/eventsurrender.c index e29d203f71..b740721e22 100644 --- a/cpukit/rtems/src/eventsurrender.c +++ b/cpukit/rtems/src/eventsurrender.c @@ -85,7 +85,7 @@ void _Event_Surrender( success = _Thread_Wait_flags_try_change_critical( the_thread, intend_to_block, - wait_class | THREAD_WAIT_STATE_INTERRUPT_SATISFIED + wait_class | THREAD_WAIT_STATE_READY_AGAIN ); if ( success ) { _Event_Satisfy( the_thread, event, pending_events, seized_events ); @@ -94,7 +94,7 @@ void _Event_Surrender( _Event_Satisfy( the_thread, event, pending_events, seized_events ); _Thread_Wait_flags_set( the_thread, - wait_class | THREAD_WAIT_STATE_SATISFIED + wait_class | THREAD_WAIT_STATE_READY_AGAIN ); unblock = true; } else { diff --git a/cpukit/rtems/src/eventtimeout.c b/cpukit/rtems/src/eventtimeout.c index 9c091748c0..5db118b183 100644 --- a/cpukit/rtems/src/eventtimeout.c +++ b/cpukit/rtems/src/eventtimeout.c @@ -45,7 +45,7 @@ void _Event_Timeout( success = _Thread_Wait_flags_try_change_critical( the_thread, intend_to_block, - wait_class | THREAD_WAIT_STATE_INTERRUPT_TIMEOUT + wait_class | THREAD_WAIT_STATE_READY_AGAIN ); if ( success ) { @@ -55,7 +55,7 @@ void _Event_Timeout( the_thread->Wait.return_code = RTEMS_TIMEOUT; _Thread_Wait_flags_set( the_thread, - wait_class | THREAD_WAIT_STATE_TIMEOUT + wait_class | THREAD_WAIT_STATE_READY_AGAIN ); unblock = true; } else { diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h index 72e011ccff..112bd22e63 100644 --- a/cpukit/score/include/rtems/score/thread.h +++ b/cpukit/score/include/rtems/score/thread.h @@ -324,11 +324,8 @@ typedef union { * * The mutually exclusive wait state flags are * - @ref THREAD_WAIT_STATE_INTEND_TO_BLOCK, - * - @ref THREAD_WAIT_STATE_BLOCKED, - * - @ref THREAD_WAIT_STATE_SATISFIED, - * - @ref THREAD_WAIT_STATE_TIMEOUT, - * - @ref THREAD_WAIT_STATE_INTERRUPT_SATISFIED, and - * - @ref THREAD_WAIT_STATE_INTERRUPT_TIMEOUT, + * - @ref THREAD_WAIT_STATE_BLOCKED, and + * - @ref THREAD_WAIT_STATE_READY_AGAIN. */ typedef unsigned int Thread_Wait_flags; diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h index 84c9ac316f..3577a7493b 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -1138,28 +1138,11 @@ RTEMS_INLINE_ROUTINE void _Thread_Priority_restore_default_change_handler( #define THREAD_WAIT_STATE_BLOCKED 0x2U /** - * @brief Indicates that the thread progress condition is satisfied and it is - * ready to resume execution. - */ -#define THREAD_WAIT_STATE_SATISFIED 0x4U - -/** - * @brief Indicates that a timeout occurred and the thread is ready to resume - * execution. - */ -#define THREAD_WAIT_STATE_TIMEOUT 0x8U - -/** - * @brief Indicates that the thread progress condition was satisfied during the - * blocking operation and it is ready to resume execution. - */ -#define THREAD_WAIT_STATE_INTERRUPT_SATISFIED 0x10U - -/** - * @brief Indicates that a timeout occurred during the blocking operation and - * the thread is ready to resume execution. + * @brief Indicates that a condition to end the thread wait occurred. + * + * This could be a timeout, a signal, an event or a resource availability. */ -#define THREAD_WAIT_STATE_INTERRUPT_TIMEOUT 0x20U +#define THREAD_WAIT_STATE_READY_AGAIN 0x4U /** * @brief Mask to get the thread wait class flags. |