10 #ifndef _LOG4CPP_THREADING_BOOSTTHREADS_HH
11 #define _LOG4CPP_THREADING_BOOSTTHREADS_HH
14 #include <boost/thread/thread.hpp>
15 #include <boost/thread/mutex.hpp>
16 #include <boost/thread/tss.hpp>
25 sprintf(buffer,
"not available");
26 return std::string(buffer);
29 typedef boost::mutex
Mutex;
34 inline T*
get()
const {
35 return _localData.get();
38 inline T*
operator->()
const {
return _localData.get(); };
39 inline T&
operator*()
const {
return *_localData.get(); };
42 return _localData.release();
45 inline void reset(T* p = NULL) {
50 boost::thread_specific_ptr<T> _localData;
T & operator*() const
Definition: BoostThreads.hh:39
This class holds Thread local data of type T, i.e.
Definition: BoostThreads.hh:32
T * operator->() const
Definition: BoostThreads.hh:38
T * release()
Definition: BoostThreads.hh:41
boost::mutex Mutex
Dummy type 'int' for Mutex.
Definition: BoostThreads.hh:27
void reset(T *p=NULL)
Definition: BoostThreads.hh:45
static std::string getThreadId()
Return an identifier for the current thread.
Definition: BoostThreads.hh:22
boost::mutex::scoped_lock ScopedLock
Dummy type 'int' defintion of ScopedLock;.
Definition: BoostThreads.hh:30