1 | /** |
---|
2 | * @file rtems/posix/rwlock.h |
---|
3 | * |
---|
4 | * This include file contains all the constants and structures associated |
---|
5 | * with the POSIX RWLock Manager. |
---|
6 | * |
---|
7 | * Directives provided are: |
---|
8 | * |
---|
9 | * - create a RWLock |
---|
10 | * - delete a RWLock |
---|
11 | * - wait for a RWLock |
---|
12 | */ |
---|
13 | |
---|
14 | /* |
---|
15 | * COPYRIGHT (c) 1989-2011. |
---|
16 | * On-Line Applications Research Corporation (OAR). |
---|
17 | * |
---|
18 | * The license and distribution terms for this file may be |
---|
19 | * found in the file LICENSE in this distribution or at |
---|
20 | * http://www.rtems.com/license/LICENSE. |
---|
21 | */ |
---|
22 | |
---|
23 | #ifndef _RTEMS_POSIX_RWLOCK_H |
---|
24 | #define _RTEMS_POSIX_RWLOCK_H |
---|
25 | |
---|
26 | #ifdef __cplusplus |
---|
27 | extern "C" { |
---|
28 | #endif |
---|
29 | |
---|
30 | /** |
---|
31 | * @defgroup POSIX_RWLOCK POSIX RWLock Manager |
---|
32 | * |
---|
33 | * @ingroup POSIX |
---|
34 | * |
---|
35 | * @brief Constants and Structures Associated with the POSIX RWLock Manager |
---|
36 | */ |
---|
37 | |
---|
38 | #include <rtems/score/object.h> |
---|
39 | #include <rtems/score/corerwlock.h> |
---|
40 | |
---|
41 | /** |
---|
42 | * This type defines the control block used to manage each RWLock. |
---|
43 | */ |
---|
44 | |
---|
45 | typedef struct { |
---|
46 | /** This is used to manage a RWLock as an object. */ |
---|
47 | Objects_Control Object; |
---|
48 | /** This is used to implement the RWLock. */ |
---|
49 | CORE_RWLock_Control RWLock; |
---|
50 | } POSIX_RWLock_Control; |
---|
51 | |
---|
52 | /** |
---|
53 | * The following defines the information control block used to manage |
---|
54 | * this class of objects. |
---|
55 | */ |
---|
56 | |
---|
57 | POSIX_EXTERN Objects_Information _POSIX_RWLock_Information; |
---|
58 | |
---|
59 | /** |
---|
60 | * @brief _POSIX_RWLock_Manager_initialization |
---|
61 | * |
---|
62 | * This routine performs the initialization necessary for this manager. |
---|
63 | * |
---|
64 | * @param[in] maximum_rwlocks is the total number of RWLocks allowed to |
---|
65 | * concurrently be active in the system. |
---|
66 | */ |
---|
67 | |
---|
68 | void _POSIX_RWLock_Manager_initialization(void); |
---|
69 | |
---|
70 | /** |
---|
71 | * @brief POSIX RWLock Translate Core RWLock Return Code |
---|
72 | * |
---|
73 | * This routine translates SuperCore RWLock status codes into the |
---|
74 | * corresponding POSIX ones. |
---|
75 | * |
---|
76 | * |
---|
77 | * @param[in] the_RWLock_status is the SuperCore status. |
---|
78 | * |
---|
79 | * @return the corresponding POSIX status |
---|
80 | */ |
---|
81 | int _POSIX_RWLock_Translate_core_RWLock_return_code( |
---|
82 | CORE_RWLock_Status the_RWLock_status |
---|
83 | ); |
---|
84 | |
---|
85 | #ifndef __RTEMS_APPLICATION__ |
---|
86 | #include <rtems/posix/rwlock.inl> |
---|
87 | #endif |
---|
88 | |
---|
89 | #ifdef __cplusplus |
---|
90 | } |
---|
91 | #endif |
---|
92 | |
---|
93 | #endif |
---|
94 | /* end of include file */ |
---|