summaryrefslogtreecommitdiffstats
path: root/examples/performance-thread/common/lthread_tls.h
blob: 4c262e98b019248d3ba0cfb8c37074130c070423 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* SPDX-License-Identifier: BSD-3-Clause
 * Copyright(c) 2015 Intel Corporation
 */

#ifndef LTHREAD_TLS_H_
#define LTHREAD_TLS_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "lthread_api.h"

#define RTE_PER_LTHREAD_SECTION_SIZE \
(&__stop_per_lt - &__start_per_lt)

struct lthread_key {
	tls_destructor_func destructor;
};

struct lthread_tls {
	void *data[LTHREAD_MAX_KEYS];
	int  nb_keys_inuse;
	struct lthread_sched *root_sched;
};

void _lthread_tls_destroy(struct lthread *lt);
void _lthread_key_pool_init(void);
void _lthread_tls_alloc(struct lthread *lt);

#ifdef __cplusplus
}
#endif

#endif				/* LTHREAD_TLS_H_ */