|
Qore Programming Language
0.9.16
|
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
DLLLOCAL ~QoreThreadLocalStorage()
destroys the key
Definition: QoreThreadLocalStorage.h:62
DLLLOCAL void create()
creates the key
Definition: QoreThreadLocalStorage.h:67
provides access to thread-local storage
Definition: QoreThreadLocalStorage.h:44
DLLLOCAL void destroy()
destroys the key
Definition: QoreThreadLocalStorage.h:72
DLLLOCAL void set(T *ptr)
sets the key's value
Definition: QoreThreadLocalStorage.h:82
pthread_key_t key
the actual thread local storage key wrapped in this class
Definition: QoreThreadLocalStorage.h:47
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 T * get()
retrieves the key's value
Definition: QoreThreadLocalStorage.h:77