32 #ifndef _QORE_QORETHREADLOCALSTORAGE_H 34 #define _QORE_QORETHREADLOCALSTORAGE_H 68 pthread_key_create(&key, 0);
73 pthread_key_delete(key);
78 return (T *)pthread_getspecific(key);
82 DLLLOCAL
void set(T *ptr) {
84 pthread_setspecific(key, (
void *)ptr);
86 int rc = pthread_setspecific(key, (
void *)ptr);
92 #endif // _QORE_QORETHREADLOCALSTORAGE_H provides access to thread-local storage
Definition: QoreThreadLocalStorage.h:44
DLLLOCAL QoreThreadLocalStorage & operator=(const QoreThreadLocalStorage &)
this function is not implemented; it is here as a private function in order to prohibit it from being...
DLLLOCAL QoreThreadLocalStorage()
creates the key
Definition: QoreThreadLocalStorage.h:57
DLLLOCAL void destroy()
destroys the key
Definition: QoreThreadLocalStorage.h:72
DLLLOCAL void create()
creates the key
Definition: QoreThreadLocalStorage.h:67
DLLLOCAL ~QoreThreadLocalStorage()
destroys the key
Definition: QoreThreadLocalStorage.h:62
pthread_key_t key
the actual thread local storage key wrapped in this class
Definition: QoreThreadLocalStorage.h:47