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