26template<
typename TYPE>
47template<
typename TYPE>
51 int res = pthread_key_create(&this->
key, NULL);
53 pthread_setspecific(this->
key, 0);
59template<
typename TYPE>
62 int res = pthread_key_delete(this->key);
70template<
typename TYPE>
void
73 pthread_setspecific(this->key, p);
79template<
typename TYPE> TYPE*
82 return (TYPE*) pthread_getspecific(this->key);
88template<
typename TYPE>
bool
91 return (0 != pthread_getspecific(this->key));
GCC doesn't implement the __thread modifier on OSX.
Definition posixthreadlocalptr.h:28
OSXThreadLocalPtr()
default constructor
bool isvalid() const
test if content is valid
pthread_key_t key
Definition osxthreadlocalptr.h:41
~OSXThreadLocalPtr()
destructor
void set(TYPE *p)
set content
TYPE * get() const
get content
#define n_assert(exp)
Definition debug.h:50
Definition osxsysfunc.h:21