26template<
typename TYPE>
27class OSXThreadLocalPtr
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));
OSXThreadLocalPtr()
default constructor
Definition osxthreadlocalptr.h:48
bool isvalid() const
test if content is valid
Definition osxthreadlocalptr.h:89
pthread_key_t key
Definition osxthreadlocalptr.h:41
~OSXThreadLocalPtr()
destructor
Definition osxthreadlocalptr.h:60
void set(TYPE *p)
set content
Definition osxthreadlocalptr.h:71
TYPE * get() const
get content
Definition osxthreadlocalptr.h:80
#define n_assert(exp)
Definition debug.h:50
Definition osxsysfunc.h:21