2007-01-26 19:36:29 +03:00
|
|
|
/*
|
2022-08-30 06:26:19 +03:00
|
|
|
* Copyright 2003-2021, Haiku, Inc. All rights reserved.
|
2007-01-26 19:36:29 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2002-10-23 17:54:44 +04:00
|
|
|
#ifndef _TLS_H
|
2014-06-25 03:25:27 +04:00
|
|
|
#define _TLS_H
|
2007-01-26 19:36:29 +03:00
|
|
|
|
2002-10-23 17:54:44 +04:00
|
|
|
|
|
|
|
#include <SupportDefs.h>
|
|
|
|
|
2007-01-26 19:36:29 +03:00
|
|
|
|
2003-01-06 10:57:10 +03:00
|
|
|
/* A maximum of 64 keys is allowed to store in TLS - the key is reserved
|
|
|
|
* process-wide. Note that tls_allocate() will return B_NO_MEMORY if you
|
|
|
|
* try to exceed this limit.
|
|
|
|
*/
|
2007-01-26 19:36:29 +03:00
|
|
|
#define TLS_MAX_KEYS 64
|
|
|
|
|
2002-10-23 17:54:44 +04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
2014-06-25 03:25:27 +04:00
|
|
|
#endif /* __cplusplus */
|
2002-10-23 17:54:44 +04:00
|
|
|
|
2003-01-06 10:57:10 +03:00
|
|
|
extern int32 tls_allocate(void);
|
|
|
|
extern void *tls_get(int32 index);
|
|
|
|
extern void **tls_address(int32 index);
|
|
|
|
extern void tls_set(int32 index, void *value);
|
2002-10-23 17:54:44 +04:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
2014-06-25 03:25:27 +04:00
|
|
|
#endif /* __cplusplus */
|
2002-10-23 17:54:44 +04:00
|
|
|
|
2003-01-06 10:57:10 +03:00
|
|
|
#endif /* _TLS_H */
|