RTEMS
schedulerpriorityyield.c
Go to the documentation of this file.
1 
8 /*
9  * Copyright (C) 2010 Gedare Bloom.
10  * Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
11  *
12  * The license and distribution terms for this file may be
13  * found in the file LICENSE in this distribution or at
14  * http://www.rtems.org/license/LICENSE.
15  */
16 
17 #ifdef HAVE_CONFIG_H
18 #include "config.h"
19 #endif
20 
22 #include <rtems/score/threadimpl.h>
23 
25  const Scheduler_Control *scheduler,
26  Thread_Control *the_thread,
27  Scheduler_Node *node
28 )
29 {
30  Scheduler_priority_Node *the_node;
31  Chain_Control *ready_chain;
32 
33  the_node = _Scheduler_priority_Node_downcast( node );
34  ready_chain = the_node->Ready_queue.ready_chain;
35 
36  if ( !_Chain_Has_only_one_node( ready_chain ) ) {
37  _Chain_Extract_unprotected( &the_thread->Object.Node );
38  _Chain_Append_unprotected( ready_chain, &the_thread->Object.Node );
39  }
40 
41  _Scheduler_priority_Schedule_body( scheduler, the_thread, true );
42 }
Inlined Routines Associated with the Manipulation of the Priority-Based Scheduling Structures...
static __inline__ void _Chain_Append_unprotected(Chain_Control *the_chain, Chain_Node *the_node)
Appends a node (unprotected).
Definition: chainimpl.h:680
Scheduler_priority_Ready_queue Ready_queue
The associated ready queue of this node.
Chain_Node Node
Definition: objectdata.h:41
static __inline__ Scheduler_priority_Node * _Scheduler_priority_Node_downcast(Scheduler_Node *node)
Gets the priority node of the scheduler node.
Objects_Control Object
Definition: thread.h:727
void _Scheduler_priority_Yield(const Scheduler_Control *scheduler, Thread_Control *the_thread, Scheduler_Node *node)
Performs the yield of a thread.
static __inline__ bool _Chain_Has_only_one_node(const Chain_Control *the_chain)
Checks if this chain has only one node.
Definition: chainimpl.h:450
static __inline__ void _Chain_Extract_unprotected(Chain_Node *the_node)
Extracts this node (unprotected).
Definition: chainimpl.h:558
Scheduler node specialization for Deterministic Priority schedulers.
static __inline__ void _Scheduler_priority_Schedule_body(const Scheduler_Control *scheduler, Thread_Control *the_thread, bool force_dispatch)
Scheduling decision logic.
Scheduler control.
Definition: scheduler.h:264
Scheduler node for per-thread data.
Definition: schedulernode.h:79
Inlined Routines from the Thread Handler.