source: rtems/cpukit/score/include/rtems/score/coremutex.h @ b5f1b24

5
Last change on this file since b5f1b24 was 300f6a48, checked in by Sebastian Huber <sebastian.huber@…>, on 06/22/16 at 15:09:23

score: Rework thread priority management

Add priority nodes which contribute to the overall thread priority.

The actual priority of a thread is now an aggregation of priority nodes.
The thread priority aggregation for the home scheduler instance of a
thread consists of at least one priority node, which is normally the
real priority of the thread. The locking protocols (e.g. priority
ceiling and priority inheritance), rate-monotonic period objects and the
POSIX sporadic server add, change and remove priority nodes.

A thread changes its priority now immediately, e.g. priority changes are
not deferred until the thread releases its last resource.

Replace the _Thread_Change_priority() function with

  • _Thread_Priority_perform_actions(),
  • _Thread_Priority_add(),
  • _Thread_Priority_remove(),
  • _Thread_Priority_change(), and
  • _Thread_Priority_update().

Update #2412.
Update #2556.

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/**
2 * @file
3 *
4 * @brief CORE Mutex API
5 *
6 * This include file contains all the constants and structures associated with
7 * the Mutex Handler.  A mutex is an enhanced version of the standard Dijkstra
8 * binary semaphore used to provide synchronization and mutual exclusion
9 * capabilities.
10 */
11
12/*
13 *  COPYRIGHT (c) 1989-2011.
14 *  On-Line Applications Research Corporation (OAR).
15 *
16 *  The license and distribution terms for this file may be
17 *  found in the file LICENSE in this distribution or at
18 *  http://www.rtems.org/license/LICENSE.
19 */
20
21#ifndef _RTEMS_SCORE_COREMUTEX_H
22#define _RTEMS_SCORE_COREMUTEX_H
23
24#include <rtems/score/thread.h>
25#include <rtems/score/threadq.h>
26#include <rtems/score/priority.h>
27#include <rtems/score/watchdog.h>
28#include <rtems/score/interr.h>
29
30struct Scheduler_Control;
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36/**
37 *  @defgroup ScoreMutex Mutex Handler
38 *
39 *  @ingroup Score
40 *
41 *  This handler encapsulates functionality which provides the foundation
42 *  Mutex services used in all of the APIs supported by RTEMS.
43 */
44/**@{*/
45
46/**
47 *  @brief Control block used to manage each mutex.
48 *
49 *  The following defines the control block used to manage each mutex.
50 */
51typedef struct {
52  /**
53   * @brief The thread queue of this mutex.
54   *
55   * The owner of the thread queue indicates the mutex owner.
56   */
57  Thread_queue_Control Wait_queue;
58} CORE_mutex_Control;
59
60/**
61 * @brief The recursive mutex control.
62 */
63typedef struct {
64  /**
65   * @brief The plain non-recursive mutex.
66   */
67  CORE_mutex_Control Mutex;
68
69  /**
70   * @brief The nest level in case of a recursive seize.
71   */
72  unsigned int nest_level;
73} CORE_recursive_mutex_Control;
74
75/**
76 * @brief The recursive mutex control with priority ceiling protocol support.
77 */
78typedef struct {
79  /**
80   * @brief The plain recursive mutex.
81   */
82  CORE_recursive_mutex_Control Recursive;
83
84  /**
85   * @brief The priority ceiling node for the mutex owner.
86   */
87  Priority_Node Priority_ceiling;
88
89#if defined(RTEMS_SMP)
90  /**
91   * @brief The scheduler instance for this priority ceiling mutex.
92   */
93  const struct Scheduler_Control *scheduler;
94#endif
95} CORE_ceiling_mutex_Control;
96
97/**@}*/
98
99#ifdef __cplusplus
100}
101#endif
102
103#endif
104/*  end of include file */
Note: See TracBrowser for help on using the repository browser.