diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-04-21 10:17:13 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-05-19 12:00:45 +0200 |
commit | 568af83542eec9343c24d417ed6a219d22046233 (patch) | |
tree | f66fde552c81c31930df66cb8a00444efeb0f30a /cpukit/score/include/rtems/score/threadimpl.h | |
parent | score: Add Thread_queue_Control::Lock (diff) | |
download | rtems-568af83542eec9343c24d417ed6a219d22046233.tar.bz2 |
score: Add Thread_queue_Operations
Replace the Thread_Priority_control with more general
Thread_queue_Operations which will be used for generic priority change,
timeout, signal and wait queue operations in the future.
Update #2273.
Diffstat (limited to 'cpukit/score/include/rtems/score/threadimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/threadimpl.h | 88 |
1 files changed, 53 insertions, 35 deletions
diff --git a/cpukit/score/include/rtems/score/threadimpl.h b/cpukit/score/include/rtems/score/threadimpl.h index c266a9cce3..953b88b925 100644 --- a/cpukit/score/include/rtems/score/threadimpl.h +++ b/cpukit/score/include/rtems/score/threadimpl.h @@ -30,6 +30,7 @@ #include <rtems/score/resourceimpl.h> #include <rtems/score/statesimpl.h> #include <rtems/score/sysstate.h> +#include <rtems/score/threadqimpl.h> #include <rtems/score/todimpl.h> #include <rtems/config.h> @@ -1078,41 +1079,6 @@ RTEMS_INLINE_ROUTINE void _Thread_Lock_restore_default( do { } while ( 0 ) #endif -void _Thread_Priority_change_do_nothing( - Thread_Control *the_thread, - Priority_Control new_priority, - void *context -); - -/** - * @brief Sets the thread priority change handler and its context. - * - * @param[in] the_thread The thread. - * @param[in] new_handler The new handler. - * @param[in] new_context The new handler context. - */ -RTEMS_INLINE_ROUTINE void _Thread_Priority_set_change_handler( - Thread_Control *the_thread, - Thread_Priority_change_handler new_handler, - void *new_context -) -{ - the_thread->Priority.change_handler = new_handler; - the_thread->Priority.change_handler_context = new_context; -} - -/** - * @brief Restores the thread priority change default handler and its context. - * - * @param[in] the_thread The thread. - */ -RTEMS_INLINE_ROUTINE void _Thread_Priority_restore_default_change_handler( - Thread_Control *the_thread -) -{ - the_thread->Priority.change_handler = _Thread_Priority_change_do_nothing; -} - /** * @brief The initial thread wait flags value set by _Thread_Initialize(). */ @@ -1258,6 +1224,58 @@ RTEMS_INLINE_ROUTINE bool _Thread_Wait_flags_try_change( } /** + * @brief Sets the thread queue. + * + * The caller must be the owner of the thread lock. + * + * @param[in] the_thread The thread. + * @param[in] new_queue The new queue. + * + * @see _Thread_Lock_set(). + */ +RTEMS_INLINE_ROUTINE void _Thread_Wait_set_queue( + Thread_Control *the_thread, + Thread_queue_Control *new_queue +) +{ + the_thread->Wait.queue = new_queue; +} + +/** + * @brief Sets the thread queue operations. + * + * The caller must be the owner of the thread lock. + * + * @param[in] the_thread The thread. + * @param[in] new_operations The new queue operations. + * + * @see _Thread_Lock_set() and _Thread_Wait_restore_default_operations(). + */ +RTEMS_INLINE_ROUTINE void _Thread_Wait_set_operations( + Thread_Control *the_thread, + const Thread_queue_Operations *new_operations +) +{ + the_thread->Wait.operations = new_operations; +} + +/** + * @brief Restores the default thread queue operations. + * + * The caller must be the owner of the thread lock. + * + * @param[in] the_thread The thread. + * + * @see _Thread_Wait_set_operations(). + */ +RTEMS_INLINE_ROUTINE void _Thread_Wait_restore_default_operations( + Thread_Control *the_thread +) +{ + the_thread->Wait.operations = &_Thread_queue_Operations_default; +} + +/** * @brief Sets the thread wait timeout code. * * @param[in] the_thread The thread. |