RTEMS 6.1-rc1
key.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/*
13 * Copyright (c) 2012 Zhongwei Yao.
14 * COPYRIGHT (c) 1989-2011.
15 * On-Line Applications Research Corporation (OAR).
16 * Copyright (c) 2016 embedded brains GmbH & Co. KG
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions
20 * are met:
21 * 1. Redistributions of source code must retain the above copyright
22 * notice, this list of conditions and the following disclaimer.
23 * 2. Redistributions in binary form must reproduce the above copyright
24 * notice, this list of conditions and the following disclaimer in the
25 * documentation and/or other materials provided with the distribution.
26 *
27 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
28 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40#ifndef _RTEMS_POSIX_KEY_H
41#define _RTEMS_POSIX_KEY_H
42
43#include <pthread.h>
44
45#include <rtems/score/chain.h>
46#include <rtems/score/object.h>
47#include <rtems/score/rbtree.h>
48#include <rtems/score/thread.h>
49
50#ifdef __cplusplus
51extern "C" {
52#endif
53
65typedef struct {
70
75
79 pthread_key_t key;
80
85
89 void *value;
91
101
108extern const uint32_t _POSIX_Keys_Key_value_pair_maximum;
109
113typedef struct {
117 void (*destructor) (void *);
118
124
129
138#define POSIX_KEYS_INFORMATION_DEFINE( max ) \
139 OBJECTS_INFORMATION_DEFINE( \
140 _POSIX_Keys, \
141 OBJECTS_POSIX_API, \
142 OBJECTS_POSIX_KEYS, \
143 POSIX_Keys_Control, \
144 max, \
145 OBJECTS_NO_STRING_NAME, \
146 NULL \
147 )
148
151#ifdef __cplusplus
152}
153#endif
154
155#endif
156/* end of include file */
POSIX_Keys_Key_value_pair _POSIX_Keys_Key_value_pairs[]
The initial set of POSIX key and value pairs.
Definition: keyzerokvp.c:34
const uint32_t _POSIX_Keys_Key_value_pair_maximum
The POSIX key and value pairs maximum.
Definition: keyzerokvp.c:36
Objects_Information _POSIX_Keys_Information
The POSIX Key objects information.
POSIX Threads Private Support.
This header file provides interfaces of the Red-Black Tree Handler which are used by the implementati...
This header file provides interfaces of the Chain Handler which are used by the implementation and th...
This header file provides interfaces of the Object Handler which are used by the implementation and t...
This header file provides interfaces of the Thread Handler which are used by the implementation and t...
This structure represents a chain node.
Definition: chain.h:78
Definition: objectdata.h:61
The information structure used to manage each API class of objects.
Definition: objectdata.h:198
The data structure used to manage a POSIX key.
Definition: key.h:113
Chain_Control Key_value_pairs
Key value pairs of this key.
Definition: key.h:122
Objects_Control Object
Definition: key.h:115
Represents POSIX key and value pair.
Definition: key.h:65
pthread_key_t key
The POSIX key identifier used as the tree key.
Definition: key.h:79
Chain_Node Key_node
The chain node for the key value pairs chain in POSIX_Keys_Control.
Definition: key.h:69
RBTree_Node Lookup_node
The tree node for the lookup tree in Thread_Keys_information.
Definition: key.h:74
void * value
The thread specific POSIX key value.
Definition: key.h:89
Thread_Control * thread
The corresponding thread.
Definition: key.h:84
Red-black tree node.
Definition: rbtree.h:73
Definition: thread.h:812
This union represents a chain control block.
Definition: chain.h:96