source: rtems/cpukit/score/src/schedulerdefaultnodeinit.c @ bbd6d27a

5
Last change on this file since bbd6d27a was 5c3d250, checked in by Sebastian Huber <sebastian.huber@…>, on 07/04/14 at 12:34:23

score: Implement scheduler helping protocol

The following scheduler operations return a thread in need for help

  • unblock,
  • change priority, and
  • yield.

A thread in need for help is a thread that encounters a scheduler state
change from scheduled to ready or a thread that cannot be scheduled in
an unblock operation. Such a thread can ask threads which depend on
resources owned by this thread for help.

Add a new ask for help scheduler operation. This operation is used by
_Scheduler_Ask_for_help() to help threads in need for help returned by
the operations mentioned above. This operation is also used by
_Scheduler_Thread_change_resource_root() in case the root of a resource
sub-tree changes. A use case is the ownership change of a resource.

In case it is not possible to schedule a thread in need for help, then
the corresponding scheduler node will be placed into the set of ready
scheduler nodes of the scheduler instance. Once a state change from
ready to scheduled happens for this scheduler node it may be used to
schedule the thread in need for help.

  • Property mode set to 100644
File size: 711 bytes
Line 
1/**
2 * @file
3 *
4 * @brief Scheduler Default Node Initialization Operation
5 *
6 * @ingroup ScoreScheduler
7 */
8
9/*
10 *  COPYRIGHT (c) 2011.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/score/schedulerimpl.h>
23
24void _Scheduler_default_Node_initialize(
25  const Scheduler_Control *scheduler,
26  Thread_Control          *the_thread
27)
28{
29  Scheduler_Node *node = _Scheduler_Thread_get_own_node( the_thread );
30
31  (void) scheduler;
32
33  _Scheduler_Node_do_initialize( node, the_thread );
34}
Note: See TracBrowser for help on using the repository browser.