P99
Data Structures | Macros | Typedefs | Enumerations | Functions
p99_tss.h File Reference
#include <unistd.h>
#include <sys/time.h>
#include <pthread.h>
#include "p99_defarg.h"
#include "p99_atomic.h"
+ Include dependency graph for p99_tss.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

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

Macros

#define P99_DECLARE_THREAD_LOCAL   P99_TSS_DECLARE_LOCAL
 
#define P99_DECLARE_THREAD_LOCAL_EXTERN   P99_TSS_DECLARE_LOCAL_EXTERN
 
#define P99_DEFINE_THREAD_LOCAL   P99_TSS_DEFINE_LOCAL
 
#define P99_THREAD_LOCAL   P99_TSS_LOCAL
 
#define P99_TSS_DECLARE_LOCAL(T, NAME, DTOR)
 
#define P99_TSS_LOCAL(NAME)   (*(P99_PASTE3(p00_, NAME, _type)*)p99_tss_get_alloc(&(NAME), sizeof(P99_PASTE3(p00_, NAME, _type))))
 
#define TSS_DTOR_ITERATIONS   1
 

Typedefs

typedef struct p99_tss p99_tss
 
typedef void(* tss_dtor_t) (void *)
 which is the function pointer type void (*)(void*), used for a destructor for a thread-specific storage pointer More...
 
typedef typedef **addtogroup threads C11 thread emulation on top of POSIX threads ****This is a relatively straightforward implementation of the C11 **thread model on top of POSIX threads The main difficulty this presents **is that the thread entry function signature differs between the **two C11 thread returns an< code > int</code > whereas POSIX returns **a< code > void *</code > ****You can find the thread management interfaces through the **documentation of the type ::thrd_t ****remark In addition to POSIX threads this implementation needs **some C11 atomic operations for initialization via ::call_once and **status communication ****struct tss_t tss_t
 

Enumerations

enum  thrd_status {
  thrd_timedout = ETIMEDOUT, thrd_success = 0, thrd_busy = EBUSY, thrd_error = INT_MIN,
  thrd_nomem = ENOMEM, thrd_intr = -1
}
 C11 thread function return values. More...
 

Functions

p99_tssp99_tss_init (p99_tss *p00_el, tss_dtor_t p00_f)
 
tss_t
typedef **addtogroup threads C11 thread emulation on top of POSIX threads ****This is a relatively straightforward implementation of the C11 **thread model on top of POSIX threads The main difficulty this presents **is that the thread entry function signature differs between the **two C11 thread returns an< code > int</code > whereas POSIX returns **a< code > void *</code > ****You can find the thread management interfaces through the **documentation of the type ::thrd_t ****remark In addition to POSIX threads this implementation needs **some C11 atomic operations for initialization via ::call_once and **status communication ****struct tss_t tss_t
Definition: p99_tss.h:88