|
libGimbal 0.2.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, TinyCThread will emulate this behavior by creating OS-level TLS storage. In a single-threaded build, it will use ordinary static storage.
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 39 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 51 of file gimbal_tls.h.