diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-08-11 08:32:49 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-08-11 11:13:36 +0200 |
commit | fef3ea9e87c01f7720a54d966f7c10fb85deea23 (patch) | |
tree | 5593c3ff97aa134c314d7df9cf8be743c60eb934 /cpukit/score/include/rtems/score/threadqimpl.h | |
parent | librtems++: Remove from RTEMS. (diff) | |
download | rtems-fef3ea9e87c01f7720a54d966f7c10fb85deea23.tar.bz2 |
score: Add _Thread_queue_Surrender()
Add _Thread_queue_Surrender() to unify the mutex surrender procedures
which involve a thread queue operation.
Diffstat (limited to 'cpukit/score/include/rtems/score/threadqimpl.h')
-rw-r--r-- | cpukit/score/include/rtems/score/threadqimpl.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/cpukit/score/include/rtems/score/threadqimpl.h b/cpukit/score/include/rtems/score/threadqimpl.h index 75ef4dd87e..8137800841 100644 --- a/cpukit/score/include/rtems/score/threadqimpl.h +++ b/cpukit/score/include/rtems/score/threadqimpl.h @@ -711,6 +711,33 @@ void _Thread_queue_Extract_with_proxy( Thread_Control *the_thread ); +/** + * @brief Surrenders the thread queue previously owned by the thread to the + * first enqueued thread if it exists. + * + * The owner of the thread queue must be set to NULL by the caller. + * + * This function releases the thread queue lock. In addition it performs a + * thread dispatch if necessary. + * + * @param[in] queue The actual thread queue. + * @param[in] operations The thread queue operations. + * @param[in] heads The thread queue heads. + * @param[in] previous_owner The previous owner thread surrendering the thread + * queue. + * @param[in] keep_priority Indicates if the previous owner thread should keep + * its current priority. + * @param[in] queue_context The thread queue context of the lock acquire. + */ +void _Thread_queue_Surrender( + Thread_queue_Queue *queue, + const Thread_queue_Operations *operations, + Thread_queue_Heads *heads, + Thread_Control *previous_owner, + bool keep_priority, + Thread_queue_Context *queue_context +); + RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_empty( const Thread_queue_Queue *queue ) |