Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
pthread_key.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_POSIX_PTHREAD_KEY_H_
8#define ZEPHYR_INCLUDE_POSIX_PTHREAD_KEY_H_
9
10#ifdef CONFIG_PTHREAD_IPC
11#include <sys/slist.h>
12#include <zephyr/types.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18typedef uint32_t pthread_once_t;
19
20/* pthread_key */
21typedef void *pthread_key_t;
22
23typedef struct pthread_key_obj {
24 /* List of pthread_key_data objects that contain thread
25 * specific data for the key
26 */
27 sys_slist_t key_data_l;
28
29 /* Optional destructor that is passed to pthread_key_create() */
30 void (*destructor)(void *);
31} pthread_key_obj;
32
33typedef struct pthread_thread_data {
34 sys_snode_t node;
35
36 /* Key and thread specific data passed to pthread_setspecific() */
37 pthread_key_obj *key;
38 void *spec_data;
39} pthread_thread_data;
40
41typedef struct pthread_key_data {
42 sys_snode_t node;
43 pthread_thread_data thread_data;
44} pthread_key_data;
45
46#ifdef __cplusplus
47}
48#endif
49
50#endif /* CONFIG_PTHREAD_IPC */
51
52#endif /* ZEPHYR_INCLUDE_POSIX_PTHREAD_KEY_H_*/
void
Definition: eswifi_shell.c:15
Single-linked list implementation.
struct _slist sys_slist_t
Definition: slist.h:40
struct _snode sys_snode_t
Definition: slist.h:33
static k_spinlock_key_t key
Definition: spinlock_error_case.c:14
struct k_thread thread_data
Definition: main.c:56
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60