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 Lunchbox.
LUNCHBOX_API TLS(ThreadDestructor_t dtorFunc)
Construct a new per-thread storage.
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.