static void _Thread_queue_Path_release( Thread_queue_Path *path ) { #if defined(RTEMS_SMP) Chain_Node *head; Chain_Node *node; head = _Chain_Head( &path->Links ); node = _Chain_Last( &path->Links ); if ( head != node ) { Thread_queue_Link *link; /* * The terminal link may have an owner which does not wait on a thread * queue. */ link = THREAD_QUEUE_LINK_OF_PATH_NODE( node ); if ( link->Queue_context.Wait.queue == NULL ) { _Thread_Wait_release_default_critical( link->owner, &link->Queue_context.Lock_context ); node = _Chain_Previous( node ); #if defined(RTEMS_DEBUG) _Chain_Set_off_chain( &link->Path_node ); #endif } while ( head != node ) { /* The other links have an owner which waits on a thread queue */ link = THREAD_QUEUE_LINK_OF_PATH_NODE( node ); _Assert( link->Queue_context.Wait.queue != NULL ); _Thread_queue_Link_remove( link ); _Thread_Wait_release_queue_critical( link->Queue_context.Wait.queue, &link->Queue_context ); _Thread_Wait_remove_request( link->owner, &link->Queue_context ); node = _Chain_Previous( node ); #if defined(RTEMS_DEBUG) _Chain_Set_off_chain( &link->Path_node ); #endif } } #else (void) path; #endif }
static void _Thread_Run_post_switch_actions( Thread_Control *executing ) { ISR_Level level; Per_CPU_Control *cpu_self; Thread_Action *action; cpu_self = _Thread_Action_ISR_disable_and_acquire( executing, &level ); action = _Thread_Get_post_switch_action( executing ); while ( action != NULL ) { _Chain_Set_off_chain( &action->Node ); ( *action->handler )( executing, action, cpu_self, level ); cpu_self = _Thread_Action_ISR_disable_and_acquire( executing, &level ); action = _Thread_Get_post_switch_action( executing ); } _Thread_Action_release_and_ISR_enable( cpu_self, level ); }
static #endif void _Thread_queue_Path_release_critical( Thread_queue_Context *queue_context ) { #if defined(RTEMS_SMP) Chain_Node *head; Chain_Node *node; head = _Chain_Head( &queue_context->Path.Links ); node = _Chain_Last( &queue_context->Path.Links ); while ( head != node ) { Thread_queue_Link *link; link = THREAD_QUEUE_LINK_OF_PATH_NODE( node ); if ( link->Lock_context.Wait.queue != NULL ) { _Thread_queue_Link_remove( link ); _Thread_Wait_release_queue_critical( link->Lock_context.Wait.queue, &link->Lock_context ); _Thread_Wait_remove_request( link->owner, &link->Lock_context ); } else { _Thread_Wait_release_default_critical( link->owner, &link->Lock_context.Lock_context ); } node = _Chain_Previous( node ); #if defined(RTEMS_DEBUG) _Chain_Set_off_chain( &link->Path_node ); #endif } #else (void) queue_context; #endif }