forked from Imagelibrary/rtems
score: Fix _Thread_queue_Path_release()
It is possible that the owner of the terminal link of a thread queue path waits on a thread queue. However, this thread queue has no owner, e.g. a thread queue of a message queue.
This commit is contained in:
@@ -177,19 +177,24 @@ static void _Thread_queue_Path_release( Thread_queue_Path *path )
|
|||||||
if ( head != node ) {
|
if ( head != node ) {
|
||||||
Thread_queue_Link *link;
|
Thread_queue_Link *link;
|
||||||
|
|
||||||
/* The terminal link has an owner which does not wait on a thread queue */
|
/*
|
||||||
|
* The terminal link may have an owner which does not wait on a thread
|
||||||
|
* queue.
|
||||||
|
*/
|
||||||
|
|
||||||
link = THREAD_QUEUE_LINK_OF_PATH_NODE( node );
|
link = THREAD_QUEUE_LINK_OF_PATH_NODE( node );
|
||||||
_Assert( link->Queue_context.Wait.queue == NULL );
|
|
||||||
|
|
||||||
_Thread_Wait_release_default_critical(
|
if ( link->Queue_context.Wait.queue == NULL ) {
|
||||||
link->owner,
|
_Thread_Wait_release_default_critical(
|
||||||
&link->Queue_context.Lock_context
|
link->owner,
|
||||||
);
|
&link->Queue_context.Lock_context
|
||||||
|
);
|
||||||
|
|
||||||
node = _Chain_Previous( node );
|
node = _Chain_Previous( node );
|
||||||
#if defined(RTEMS_DEBUG)
|
#if defined(RTEMS_DEBUG)
|
||||||
_Chain_Set_off_chain( &link->Path_node );
|
_Chain_Set_off_chain( &link->Path_node );
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
while ( head != node ) {
|
while ( head != node ) {
|
||||||
/* The other links have an owner which waits on a thread queue */
|
/* The other links have an owner which waits on a thread queue */
|
||||||
|
|||||||
Reference in New Issue
Block a user