11 #ifndef THREADLOCAL_HPP__
12 #define THREADLOCAL_HPP__
35 #define LOCAL_POINTER_ANNOTATION __thread
36 #elif defined(_MSC_VER)
38 #define LOCAL_POINTER_ANNOTATION __declspec(thread)
56 #if defined(TLS_PTHREAD)
71 #if defined(TLS_PTHREAD)
81 #if defined(TLS_PTHREAD)
91 #if defined(TLS_PTHREAD)
92 return static_cast<T* const
>(pthread_getspecific(
thr_local_key));
101 #if defined(TLS_PTHREAD)
113 #endif // THREADLOCAL_HPP__
ThreadLocalPointer()
Definition: thread_local.hpp:69
~ThreadLocalPointer()
Definition: thread_local.hpp:79
static LOCAL_POINTER_ANNOTATION T * thr_local_key
Definition: thread_local.hpp:59
T * operator->() const
Definition: thread_local.hpp:109
void set(T *val)
Definition: thread_local.hpp:99
T & operator*() const
Definition: thread_local.hpp:110
Definition: thread_local.hpp:50