|
P99
|
A stub structure to hold a thread local variable if thread_local is not available. More...
#include <p99_tss.h>
A stub structure to hold a thread local variable if thread_local is not available.
Don't use this type directly but use P99_DECLARE_THREAD_LOCAL to declare a variable and P99_THREAD_LOCAL to access it.
A hypothetical example for the use of such a variable would be errno:
P99_DECLARE_THREAD_LOCAL(int, errno_loc); #define errno P99_THREAD_LOCAL(errno_loc)
With just these two lines errno always evaluates to an lvalue representing a thread local object. That is you can use it everywhere a normal variable of type int could be used:
if (errno == EINTR) ...
errno = 0;
my_func(&errno);
1.7.6.1