24 #ifndef _QORE_QORETHREADLOCALSTORAGE_H
26 #define _QORE_QORETHREADLOCALSTORAGE_H
60 pthread_key_create(&
key, 0);
65 pthread_key_delete(
key);
70 return (T *)pthread_getspecific(
key);
74 DLLLOCAL
void set(T *ptr) {
76 pthread_setspecific(
key, (
void *)ptr);
78 int rc = pthread_setspecific(
key, (
void *)ptr);
84 #endif // _QORE_QORETHREADLOCALSTORAGE_H
provides access to thread-local storage
Definition: QoreThreadLocalStorage.h:36
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:49
DLLLOCAL void destroy()
destroys the key
Definition: QoreThreadLocalStorage.h:64
DLLLOCAL void create()
creates the key
Definition: QoreThreadLocalStorage.h:59
DLLLOCAL ~QoreThreadLocalStorage()
destroys the key
Definition: QoreThreadLocalStorage.h:54
pthread_key_t key
the actual thread local storage key wrapped in this class
Definition: QoreThreadLocalStorage.h:39
DLLLOCAL void set(T *ptr)
sets the key's value
Definition: QoreThreadLocalStorage.h:74