9#ifndef _LOG4SHIB_THREADING_PTHREADS_HH
10#define _LOG4SHIB_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
~Mutex()
Definition PThreads.hh:46
void lock()
Definition PThreads.hh:38
void unlock()
Definition PThreads.hh:42
~ScopedLock()
Definition PThreads.hh:68
ScopedLock(Mutex &mutex)
Definition PThreads.hh:63
T * operator->() const
Definition PThreads.hh:104
T & operator*() const
Definition PThreads.hh:105
~ThreadLocalDataHolder()
Definition PThreads.hh:92
void reset(T *p=NULL)
Definition PThreads.hh:114
T * get() const
Definition BoostThreads.hh:34
T data_type
Definition DummyThreads.hh:34
static void freeHolder(void *p)
Definition PThreads.hh:87
T * release()
Definition PThreads.hh:107
ThreadLocalDataHolder()
Definition PThreads.hh:83
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