CNDP 22.08.0
Loading...
Searching...
No Matches
cthread_tls.h
1/* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright (c) 2019-2022 Intel Corporation
3 */
4
5#ifndef _CTHREAD_TLS_H_
6#define _CTHREAD_TLS_H_
7
8#include "cthread_api.h"
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14#ifndef __APPLE__
15#define CNE_PER_CTHREAD_SECTION_SIZE ((uintptr_t)&__stop_per_dt - (uintptr_t)&__start_per_dt)
16#else
17#define CNE_PER_CTHREAD_SECTION_SIZE 0
18#endif
19
20struct cthread_key {
21 tls_destructor_func destructor;
22};
23
24struct cthread_tls {
25 void *data[CTHREAD_MAX_KEYS];
26 int nb_keys_inuse;
27 struct cthread_sched *sched;
28};
29
30void _cthread_tls_destroy(struct cthread *ct);
31void _cthread_key_pool_init(void);
32int _cthread_tls_alloc(struct cthread *ct);
33
34#ifdef __cplusplus
35}
36#endif
37
38#endif /* _CTHREAD_TLS_H_ */
#define CTHREAD_MAX_KEYS
void(*) tls_destructor_func(void *)