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

5
Last change on this file since b5f1b24 was bbd6d27a, checked in by Sebastian Huber <sebastian.huber@…>, on 04/15/16 at 14:27:56

score: Delete unused CORE_RWLock_Attributes

  • Property mode set to 100644
File size: 1.8 KB
Line 
1/**
2 *  @file  rtems/score/corerwlock.h
3 *
4 *  @brief Constants and Structures Associated with the RWLock Handler
5 *
6 *  This include file contains all the constants and structures associated
7 *  with the RWLock Handler.
8 */
9
10/*
11 *  COPYRIGHT (c) 1989-2008.
12 *  On-Line Applications Research Corporation (OAR).
13 *
14 *  The license and distribution terms for this file may be
15 *  found in the file LICENSE in this distribution or at
16 *  http://www.rtems.org/license/LICENSE.
17 */
18
19#ifndef _RTEMS_SCORE_CORERWLOCK_H
20#define _RTEMS_SCORE_CORERWLOCK_H
21
22#include <rtems/score/threadq.h>
23
24/**
25 *  @defgroup ScoreRWLock RWLock Handler
26 *
27 *  @ingroup Score
28 *
29 *  This handler encapsulates functionality which provides the foundation
30 *  RWLock services used in all of the APIs supported by RTEMS.
31 */
32/**@{*/
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38/**
39 *  RWLock State.
40 */
41typedef enum {
42  /** This indicates the the RWLock is not currently locked.
43   */
44  CORE_RWLOCK_UNLOCKED,
45  /** This indicates the the RWLock is currently locked for reading.
46   */
47  CORE_RWLOCK_LOCKED_FOR_READING,
48  /** This indicates the the RWLock is currently locked for reading.
49   */
50  CORE_RWLOCK_LOCKED_FOR_WRITING
51}   CORE_RWLock_States;
52
53/**
54 *  The following defines the control block used to manage each
55 *  RWLock.
56 */
57typedef struct {
58  /** This field is the Waiting Queue used to manage the set of tasks
59   *  which are blocked waiting for the RWLock to be released.
60   */
61  Thread_queue_Control     Wait_queue;
62  /** This element is the current state of the RWLock.
63   */
64  CORE_RWLock_States       current_state;
65  /** This element contains the current number of thread waiting for this
66   *  RWLock to be released. */
67  uint32_t                 number_of_readers;
68}   CORE_RWLock_Control;
69
70/**@}*/
71
72#ifdef __cplusplus
73}
74#endif
75
76#endif
77/*  end of include file */
Note: See TracBrowser for help on using the repository browser.