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

5
Last change on this file since e460cd00 was e460cd00, checked in by Sebastian Huber <sebastian.huber@…>, on 09/27/17 at 10:07:14

score: Rename to _Scheduler_Control

Rename struct Scheduler_Control to _Scheduler_Control to allow its use
in standard header files, e.g. <pthread.h>.

Update #3112.

  • 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.