libGimbal 0.1.0
C17-Based Extended Standard Library and Cross-Language Runtime Framework
|
Go to the source code of this file.
Macros | |
#define | GBL_TLS(type, name, ...) |
#define | GBL_TLS_LOAD(name) |
Thread-local variable management.
This file provides a pair of macros serving as an abstraction layer between a platform's preferred thread-local storage mechanism, and the application.
Where supported, GBL_TLS() will use real, compiler-enabled static TLS by simply declaring the variable with the "thread_local" keyword and proceeding to access it normally.
If this preferred path is not available, using the same semantics, the back-end emulate this behavior by creating OS-level TLS storage using TinyCThread's C11 TLS API, which uses dynamically allocated storage and key-based lookups.
Definition in file gimbal_tls.h.
#define GBL_TLS | ( | type, | |
name, | |||
... | |||
) |
Defines a thread-local variable using the given information, and either using compiler or OS-level TLS depending on the platform.
type | variable type |
name | variable name |
init | variable initializer |
Definition at line 41 of file gimbal_tls.h.
#define GBL_TLS_LOAD | ( | name | ) |
Fetches a pointer to a thread-local variable that was previously declared with GBL_TLS()
name | variable name |
Definition at line 77 of file gimbal_tls.h.