9 #ifndef _LOG4CPP_THREADING_PTHREADS_HH 10 #define _LOG4CPP_THREADING_PTHREADS_HH 35 m_sem = semMCreate( SEM_Q_PRIORITY | SEM_INVERSION_SAFE );
39 STATUS result = semTake( m_sem, WAIT_FOREVER );
65 ::pthread_mutexattr_init(&mutexattr);
66 ::pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE);
67 ::pthread_mutex_init(&mutex, &mutexattr);
71 ::pthread_mutex_lock(&mutex);
75 ::pthread_mutex_unlock(&mutex);
79 ::pthread_mutex_destroy(&mutex);
80 ::pthread_mutexattr_destroy(&mutexattr);
118 ::pthread_key_create(&_key, freeHolder);
123 delete reinterpret_cast<T *
>(p);
131 ::pthread_key_delete(_key);
134 inline T*
get()
const {
135 return reinterpret_cast<T *
>(::pthread_getspecific(_key));
143 ::pthread_setspecific(_key, NULL);
153 ::pthread_setspecific(_key, p);
definition of ScopedLock;
static void freeHolder(void *p)
Mutex & operator=(const Mutex &m)
pthread_mutexattr_t mutexattr
This class holds Thread local data of type T, i.e.
static std::string getThreadId()
Return an identifier for the current thread.
boost::mutex Mutex
Dummy type 'int' for Mutex.