source: rtems/cpukit/score/include/rtems/score/coremutex.h @ 024bffc6

5
Last change on this file since 024bffc6 was 024bffc6, checked in by Sebastian Huber <sebastian.huber@…>, on 05/30/16 at 13:00:32

score: Use owner of thread queue for CORE mutex

  • Property mode set to 100644
File size: 2.0 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
30#ifdef __cplusplus
31extern "C" {
32#endif
33
34/**
35 *  @defgroup ScoreMutex Mutex Handler
36 *
37 *  @ingroup Score
38 *
39 *  This handler encapsulates functionality which provides the foundation
40 *  Mutex services used in all of the APIs supported by RTEMS.
41 */
42/**@{*/
43
44/**
45 *  @brief Control block used to manage each mutex.
46 *
47 *  The following defines the control block used to manage each mutex.
48 */
49typedef struct {
50  /**
51   * @brief The thread queue of this mutex.
52   *
53   * The owner of the thread queue indicates the mutex owner.
54   */
55  Thread_queue_Control Wait_queue;
56} CORE_mutex_Control;
57
58/**
59 * @brief The recursive mutex control.
60 */
61typedef struct {
62  /**
63   * @brief The plain non-recursive mutex.
64   */
65  CORE_mutex_Control Mutex;
66
67  /**
68   * @brief The nest level in case of a recursive seize.
69   */
70  unsigned int nest_level;
71} CORE_recursive_mutex_Control;
72
73/**
74 * @brief The recursive mutex control with priority ceiling protocol support.
75 */
76typedef struct {
77  /**
78   * @brief The plain recursive mutex.
79   */
80  CORE_recursive_mutex_Control Recursive;
81
82  /**
83   * @brief The priority ceiling value for the mutex owner.
84   */
85  Priority_Control priority_ceiling;
86} CORE_ceiling_mutex_Control;
87
88/**@}*/
89
90#ifdef __cplusplus
91}
92#endif
93
94#endif
95/*  end of include file */
Note: See TracBrowser for help on using the repository browser.