| Server IP : 216.92.14.13 / Your IP : 216.73.217.126 Web Server : Apache System : Linux vps4089.pairvps.com 5.15.0-190-generic #200-Ubuntu SMP Fri Aug 7 15:06:04 UTC 2026 x86_64 User : rmlac2fmr ( 1040637) PHP Version : 8.2.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/include/log4cpp/threading/ |
Upload File : |
/*
* BoostThreads.hh
*
* Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
* Copyright 2002, Bastiaan Bakker. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#ifndef _LOG4CPP_THREADING_BOOSTTHREADS_HH
#define _LOG4CPP_THREADING_BOOSTTHREADS_HH
#include <log4cpp/Portability.hh>
#include <boost/thread/thread.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/tss.hpp>
#include <cstdio>
#include <string>
namespace log4cpp {
namespace threading {
static std::string getThreadId() {
char buffer[14];
// Boost.Threads stores the thread ID but doesn't expose it
sprintf(buffer, "not available");
return std::string(buffer);
};
typedef boost::mutex Mutex;
typedef boost::mutex::scoped_lock ScopedLock;
template<typename T> class ThreadLocalDataHolder {
public:
inline T* get() const {
return _localData.get();
};
inline T* operator->() const { return _localData.get(); };
inline T& operator*() const { return *_localData.get(); };
inline T* release() {
return _localData.release();
};
inline void reset(T* p = NULL) {
_localData.reset(p);
};
private:
boost::thread_specific_ptr<T> _localData;
};
}
}
#endif