P99

A stub structure to hold a thread local variable if thread_local is not available. More...

#include <p99_tss.h>


Detailed Description

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);

Definition at line 209 of file p99_tss.h.


The documentation for this struct was generated from the following file:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines