Lunchbox  1.10.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lunchbox::TLS Class Reference

Provides thread-local storage API used by PerThread and PerThreadRef. More...

#include <tls.h>

+ Inheritance diagram for lunchbox::TLS:
+ Collaboration diagram for lunchbox::TLS:

Public Types

typedef void(* ThreadDestructor_t )(void *)
 

Public Member Functions

LUNCHBOX_API TLS (ThreadDestructor_t dtorFunc)
 Construct a new per-thread storage. More...
 
LUNCHBOX_API ~TLS ()
 Destruct the per-thread storage. More...
 
LUNCHBOX_API void set (const void *data)
 Set the data for this thread-local storage. More...
 
LUNCHBOX_API void * get ()
 
LUNCHBOX_API const void * get () const
 

Detailed Description

Provides thread-local storage API used by PerThread and PerThreadRef.

Definition at line 29 of file tls.h.

Constructor & Destructor Documentation

LUNCHBOX_API lunchbox::TLS::TLS ( ThreadDestructor_t  dtorFunc)
explicit

Construct a new per-thread storage.

Parameters
dtorFuncthe destructor function called to destroy thread-local storage, not called if 0.
Version
1.7.2
LUNCHBOX_API lunchbox::TLS::~TLS ( )

Destruct the per-thread storage.

Version
1.7.2

Member Function Documentation

LUNCHBOX_API void* lunchbox::TLS::get ( )
Returns
the data for this thread-local storage.
Version
1.7.2

Referenced by lunchbox::PerThreadRef< T >::operator=(), and lunchbox::PerThread< T, D >::operator=().

+ Here is the caller graph for this function:

LUNCHBOX_API const void* lunchbox::TLS::get ( ) const
Returns
the data for this thread-local storage.
Version
1.7.2
LUNCHBOX_API void lunchbox::TLS::set ( const void *  data)

Set the data for this thread-local storage.

Version
1.7.2

The documentation for this class was generated from the following file: