1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @brief POSIX Key Private Support |
---|
5 | * |
---|
6 | * This include file contains all the private support information for |
---|
7 | * POSIX key. |
---|
8 | */ |
---|
9 | |
---|
10 | /* |
---|
11 | * COPYRIGHT (c) 1989-2011. |
---|
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.com/license/LICENSE. |
---|
17 | */ |
---|
18 | |
---|
19 | #ifndef _RTEMS_POSIX_KEY_H |
---|
20 | #define _RTEMS_POSIX_KEY_H |
---|
21 | |
---|
22 | #include <rtems/score/objectimpl.h> |
---|
23 | |
---|
24 | /** |
---|
25 | * @defgroup POSIX_KEY POSIX Key |
---|
26 | * |
---|
27 | * @ingroup POSIXAPI |
---|
28 | * |
---|
29 | */ |
---|
30 | /**@{**/ |
---|
31 | |
---|
32 | #ifdef __cplusplus |
---|
33 | extern "C" { |
---|
34 | #endif |
---|
35 | |
---|
36 | /** |
---|
37 | * This is the data Structure used to manage a POSIX key. |
---|
38 | * |
---|
39 | * NOTE: The Values is a table indexed by the index portion of the |
---|
40 | * ID of the currently executing thread. |
---|
41 | */ |
---|
42 | typedef struct { |
---|
43 | /** This field is the Object control structure. */ |
---|
44 | Objects_Control Object; |
---|
45 | /** This field points to the optional destructor method. */ |
---|
46 | void (*destructor)( void * ); |
---|
47 | /** This field points to the values per thread. */ |
---|
48 | void **Values[ OBJECTS_APIS_LAST + 1 ]; |
---|
49 | } POSIX_Keys_Control; |
---|
50 | |
---|
51 | /** |
---|
52 | * The following defines the information control block used to manage |
---|
53 | * this class of objects. |
---|
54 | */ |
---|
55 | POSIX_EXTERN Objects_Information _POSIX_Keys_Information; |
---|
56 | |
---|
57 | /** |
---|
58 | * @brief POSIX keys manager initialization. |
---|
59 | * |
---|
60 | * This routine performs the initialization necessary for this manager. |
---|
61 | */ |
---|
62 | void _POSIX_Key_Manager_initialization(void); |
---|
63 | |
---|
64 | /** |
---|
65 | * @brief Create thread-specific data POSIX key. |
---|
66 | * |
---|
67 | * This function executes all the destructors associated with the thread's |
---|
68 | * keys. This function will execute until all values have been set to NULL. |
---|
69 | * |
---|
70 | * @param[in] thread is a pointer to the thread whose keys should have |
---|
71 | * all their destructors run. |
---|
72 | * |
---|
73 | * NOTE: This is the routine executed when a thread exits to |
---|
74 | * run through all the keys and do the destructor action. |
---|
75 | */ |
---|
76 | void _POSIX_Keys_Run_destructors( |
---|
77 | Thread_Control *thread |
---|
78 | ); |
---|
79 | |
---|
80 | /** |
---|
81 | * @brief Free a POSIX key table memory. |
---|
82 | * |
---|
83 | * This memory frees the key table memory associated with @a the_key. |
---|
84 | * |
---|
85 | * @param[in] the_key is a pointer to the POSIX key to free |
---|
86 | * the table memory of. |
---|
87 | */ |
---|
88 | void _POSIX_Keys_Free_memory( |
---|
89 | POSIX_Keys_Control *the_key |
---|
90 | ); |
---|
91 | |
---|
92 | /** |
---|
93 | * @brief Free a POSIX keys control block. |
---|
94 | * |
---|
95 | * This routine frees a keys control block to the |
---|
96 | * inactive chain of free keys control blocks. |
---|
97 | * |
---|
98 | * @param[in] the_key is a pointer to the POSIX key to free. |
---|
99 | */ |
---|
100 | RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( |
---|
101 | POSIX_Keys_Control *the_key |
---|
102 | ); |
---|
103 | |
---|
104 | #include <rtems/posix/key.inl> |
---|
105 | |
---|
106 | /** @} */ |
---|
107 | |
---|
108 | #ifdef __cplusplus |
---|
109 | } |
---|
110 | #endif |
---|
111 | |
---|
112 | #endif |
---|
113 | /* end of include file */ |
---|