18 #ifndef LUNCHBOX_TLS_H
19 #define LUNCHBOX_TLS_H
22 #include <boost/noncopyable.hpp>
26 namespace detail {
class TLS; }
29 class TLS :
public boost::noncopyable
32 typedef void (*ThreadDestructor_t)(
void*);
41 LUNCHBOX_API
explicit TLS( ThreadDestructor_t dtorFunc );
47 LUNCHBOX_API
void set(
const void* data );
50 LUNCHBOX_API
void*
get();
53 LUNCHBOX_API
const void*
get()
const;
56 detail::TLS*
const impl_;
60 #endif //LUNCHBOX_TLS_H
Defines export visibility macros for library Lunchbox.
LUNCHBOX_API TLS(ThreadDestructor_t dtorFunc)
Construct a new per-thread storage.
Abstraction layer and common utilities for multi-threaded programming.
Provides thread-local storage API used by PerThread and PerThreadRef.
LUNCHBOX_API ~TLS()
Destruct the per-thread storage.
LUNCHBOX_API void set(const void *data)
Set the data for this thread-local storage.