9 #ifndef _LOG4CPP_THREADING_PTHREADS_HH
10 #define _LOG4CPP_THREADING_PTHREADS_HH
31 pthread_mutex_t mutex;
35 ::pthread_mutex_init(&mutex, NULL);
39 ::pthread_mutex_lock(&mutex);
43 ::pthread_mutex_unlock(&mutex);
47 ::pthread_mutex_destroy(&mutex);
76 template<
typename T>
class ThreadLocalDataHolder {
89 delete reinterpret_cast<T *
>(p);
97 ::pthread_key_delete(_key);
101 return reinterpret_cast<T *
>(::pthread_getspecific(_key));
109 ::pthread_setspecific(_key, NULL);
119 ::pthread_setspecific(_key, p);
Definition: PThreads.hh:29
Mutex()
Definition: PThreads.hh:34
void lock()
Definition: PThreads.hh:38
void unlock()
Definition: PThreads.hh:42
~Mutex()
Definition: PThreads.hh:46
definition of ScopedLock;
Definition: PThreads.hh:58
ScopedLock(Mutex &mutex)
Definition: PThreads.hh:63
~ScopedLock()
Definition: PThreads.hh:68
T * get() const
Definition: BoostThreads.hh:34
T * release()
Definition: PThreads.hh:107
~ThreadLocalDataHolder()
Definition: PThreads.hh:92
T & operator*() const
Definition: PThreads.hh:105
T data_type
Definition: PThreads.hh:81
ThreadLocalDataHolder()
Definition: PThreads.hh:83
static void freeHolder(void *p)
Definition: PThreads.hh:87
void reset(T *p=NULL)
Definition: PThreads.hh:114
T * operator->() const
Definition: PThreads.hh:104
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