source: rtems/cpukit/posix/include/rtems/posix/key.h @ 45c4499e

4.104.115
Last change on this file since 45c4499e was f8437c8, checked in by Ralf Corsepius <ralf.corsepius@…>, on 09/04/08 at 15:23:12

Convert to "bool".

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/**
2 * @file rtems/posix/key.h
3 */
4
5/*  rtems/posix/key.h
6 *
7 *  This include file contains all the private support information for
8 *  POSIX key.
9 *
10 *  COPYRIGHT (c) 1989-1999.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.com/license/LICENSE.
16 *
17 *  $Id$
18 */
19
20#ifndef _RTEMS_POSIX_KEY_H
21#define _RTEMS_POSIX_KEY_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/*
28 *  Data Structure used to manage a POSIX key
29 *
30 *  NOTE:  The Values is a table indexed by the index portion of the
31 *         ID of the currently executing thread.
32 */
33
34typedef struct {
35   Objects_Control     Object;
36   bool                is_active;
37   void              (*destructor)( void * );
38   void              **Values[ OBJECTS_APIS_LAST + 1 ];
39}  POSIX_Keys_Control;
40
41/*
42 *  The following defines the information control block used to manage
43 *  this class of objects.
44 */
45
46POSIX_EXTERN Objects_Information  _POSIX_Keys_Information;
47
48/*
49 *  _POSIX_Keys_Manager_initialization
50 *
51 *  DESCRIPTION:
52 *
53 *  This routine performs the initialization necessary for this manager.
54 */
55
56void _POSIX_Key_Manager_initialization(
57  uint32_t   maximum_keys
58);
59
60/*
61 *  _POSIX_Keys_Run_destructors
62 *
63 *  DESCRIPTION:
64 *
65 *  This function executes all the destructors associated with the thread's
66 *  keys.  This function will execute until all values have been set to NULL.
67 *
68 *  NOTE:  This is the routine executed when a thread exits to
69 *         run through all the keys and do the destructor action.
70 */
71
72void _POSIX_Keys_Run_destructors(
73  Thread_Control *thread
74);
75
76/*
77 *  _POSIX_Keys_Allocate
78 *
79 *  DESCRIPTION:
80 *
81 *  This function allocates a keys control block from
82 *  the inactive chain of free keys control blocks.
83 */
84
85RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void );
86
87/*
88 *  _POSIX_Keys_Free
89 *
90 *  DESCRIPTION:
91 *
92 *  This routine frees a keys control block to the
93 *  inactive chain of free keys control blocks.
94 */
95
96RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free (
97  POSIX_Keys_Control *the_key
98);
99
100/*
101 *  _POSIX_Keys_Get
102 *
103 *  DESCRIPTION:
104 *
105 *  This function maps key IDs to key control blocks.
106 *  If ID corresponds to a local keys, then it returns
107 *  the_key control pointer which maps to ID and location
108 *  is set to OBJECTS_LOCAL.  if the keys ID is global and
109 *  resides on a remote node, then location is set to OBJECTS_REMOTE,
110 *  and the_key is undefined.  Otherwise, location is set
111 *  to OBJECTS_ERROR and the_key is undefined.
112 */
113
114RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get (
115  Objects_Id         id,
116  Objects_Locations *location
117);
118
119/*
120 *  _POSIX_Keys_Is_null
121 *
122 *  DESCRIPTION:
123 *
124 *  This function returns TRUE if the_key is NULL and FALSE otherwise.
125 */
126
127RTEMS_INLINE_ROUTINE bool _POSIX_Keys_Is_null (
128  POSIX_Keys_Control *the_key
129);
130
131#include <rtems/posix/key.inl>
132
133#ifdef __cplusplus
134}
135#endif
136
137#endif
138/*  end of include file */
Note: See TracBrowser for help on using the repository browser.