21 : tls_( (
TLS::ThreadDestructor_t)D )
27 template<
class T,
void (*D)( T* ) >
30 tls_.set( static_cast< const void* >( data ));
34 template<
class T,
void (*D)( T* ) >
37 tls_.set( rhs.tls_.
get( ));
43 return static_cast< T*
>( tls_.get( ));
48 return static_cast< const T*
>( tls_.get( ));
53 return static_cast< T*
>( tls_.get( ));
56 template<
class T,
void (*D)( T* ) >
59 return static_cast< T*
>( tls_.get( ));
64 return tls_.get() == 0;
69 return tls_.get() != 0;
PerThread()
Construct a new per-thread variable.
PerThread< T, D > & operator=(const T *data)
Assign an object to the thread-local storage.
~PerThread()
Destruct the per-thread variable.
Implements thread-specific storage for C++ objects.
T * operator->()
Access the thread-local object.
LUNCHBOX_API void * get()
Provides thread-local storage API used by PerThread and PerThreadRef.