9#ifndef _LOG4CPP_THREADING_PTHREADS_HH
10#define _LOG4CPP_THREADING_PTHREADS_HH
30 pthread_mutex_t mutex;
34 ::pthread_mutex_init(&mutex, NULL);
38 ::pthread_mutex_lock(&mutex);
42 ::pthread_mutex_unlock(&mutex);
46 ::pthread_mutex_destroy(&mutex);
74 template <
typename T>
class ThreadLocalDataHolder {
87 delete reinterpret_cast<T*
>(p);
95 ::pthread_key_delete(_key);
98 inline T*
get()
const {
99 return reinterpret_cast<T*
>(::pthread_getspecific(_key));
111 ::pthread_setspecific(_key, NULL);
121 ::pthread_setspecific(_key, p);
Definition PThreads.hh:28
Mutex()
Definition PThreads.hh:33
void lock()
Definition PThreads.hh:37
void unlock()
Definition PThreads.hh:41
~Mutex()
Definition PThreads.hh:45
ScopedLock(Mutex &mutex)
Definition PThreads.hh:62
~ScopedLock()
Definition PThreads.hh:66
~ThreadLocalDataHolder()
Definition PThreads.hh:90
T data_type
Definition DummyThreads.hh:34
ThreadLocalDataHolder()
Definition PThreads.hh:81
T * operator->() const
Definition PThreads.hh:102
T & operator*() const
Definition PThreads.hh:105
static void freeHolder(void *p)
Definition PThreads.hh:85
T * get() const
Definition BoostThreads.hh:34
void reset(T *p=NULL)
Definition PThreads.hh:116
T * release()
Definition PThreads.hh:109
Definition BoostThreads.hh:21
static std::string getThreadId()
Return an identifier for the current thread.
Definition BoostThreads.hh:22
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16