tls_tricks::tls_manager Class Reference

List of all members.

Detailed Description

A management class for non-POD thread-local storage.

The programmer declares thread-local variables via DECLARE_TLS macro, and every thread which calls thread_init/fini at entry/exit will have its thread-local variables initialized and destroyed by their no-arg constructor and destructor.

Attention:
NOTE: the main thread automatically initializes its own TLS before entering main(), but if the main thread exits without ending the program it should call tls_manager::thread_fini like any other thread.

WARNING: for now this API does not support TLS declared within a function.

WARNING: Similar to static initialization, the programmer cannot make any assumptions about the order in which two thread-local variables get initialized unless they are declared in the same file or declared using a DECLARE_TLS_SCHWARZ/DEFINE_TLS_SCHWARZ pair.

Definition at line 106 of file tls.h.

Static Public Member Functions

static void global_init ()
static void global_fini ()
static void register_tls (void(*init)(), void(*fini)())
static void thread_init ()
static void thread_fini ()

Static Public Attributes

static __thread bool _thread_initialized


The documentation for this class was generated from the following files:
Generated on Wed Jul 7 17:22:44 2010 for Shore Storage Manager by  doxygen 1.4.7