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