1/*
2 * Copyright 2003-2021, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 */
5#ifndef _TLS_H
6#define _TLS_H
7
8
9#include <SupportDefs.h>
10
11
12/* A maximum of 64 keys is allowed to store in TLS - the key is reserved
13 * process-wide. Note that tls_allocate() will return B_NO_MEMORY if you
14 * try to exceed this limit.
15 */
16#define TLS_MAX_KEYS 64
17
18
19#ifdef __cplusplus
20extern "C" {
21#endif	/* __cplusplus */
22
23extern int32 tls_allocate(void);
24extern void *tls_get(int32 index);
25extern void **tls_address(int32 index);
26extern void tls_set(int32 index, void *value);
27
28#ifdef __cplusplus
29}
30#endif	/* __cplusplus */
31
32#endif	/* _TLS_H */
33