You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
This reverts commit f916e64927
.
This commit is contained in:
@ -29,8 +29,7 @@
|
||||
#include <algorithm>
|
||||
#include <unistd.h>
|
||||
using namespace std;
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
using namespace boost;
|
||||
|
||||
@ -59,13 +58,13 @@ namespace WriteEngine
|
||||
{
|
||||
BRMWrapper* volatile BRMWrapper::m_instance = NULL;
|
||||
boost::thread_specific_ptr<int> BRMWrapper::m_ThreadDataPtr;
|
||||
std::mutex BRMWrapper::m_instanceCreateMutex;
|
||||
boost::mutex BRMWrapper::m_instanceCreateMutex;
|
||||
|
||||
|
||||
bool BRMWrapper::m_useVb = true;
|
||||
OID BRMWrapper::m_curVBOid = INVALID_NUM;
|
||||
IDBDataFile* BRMWrapper::m_curVBFile = NULL;
|
||||
std::mutex vbFileLock;
|
||||
boost::mutex vbFileLock;
|
||||
struct fileInfoCompare // lt operator
|
||||
{
|
||||
bool operator()(const File& lhs, const File& rhs) const
|
||||
@ -301,7 +300,7 @@ BRMWrapper* BRMWrapper::getInstance()
|
||||
{
|
||||
if (m_instance == 0)
|
||||
{
|
||||
std::unique_lock lock(m_instanceCreateMutex);
|
||||
boost::mutex::scoped_lock lock(m_instanceCreateMutex);
|
||||
|
||||
if (m_instance == 0)
|
||||
{
|
||||
@ -1639,7 +1638,7 @@ int BRMWrapper::writeVB(IDBDataFile* pSourceFile, const VER_t transID, const OID
|
||||
fileInfo.fSegment = 0;
|
||||
// fileInfo.fDbRoot = (freeList[0].vbOID % rootCnt) + 1;
|
||||
fileInfo.fDbRoot = dbRoot;
|
||||
std::unique_lock lk(vbFileLock);
|
||||
boost::mutex::scoped_lock lk(vbFileLock);
|
||||
pTargetFile = openFile(fileInfo, "r+b", true);
|
||||
|
||||
if (pTargetFile == NULL)
|
||||
|
@ -464,7 +464,7 @@ class BRMWrapper : public WEObj
|
||||
|
||||
static BRMWrapper* volatile m_instance;
|
||||
static boost::thread_specific_ptr<int> m_ThreadDataPtr;
|
||||
static std::mutex m_instanceCreateMutex;
|
||||
static boost::mutex m_instanceCreateMutex;
|
||||
|
||||
EXPORT static bool m_useVb;
|
||||
|
||||
|
@ -59,9 +59,9 @@ string Config::m_bulkRoot;
|
||||
|
||||
unsigned long Config::fDBRootChangeCount = 0;
|
||||
time_t Config::fCacheTime = 0;
|
||||
std::mutex Config::fCacheLock;
|
||||
boost::mutex Config::fCacheLock;
|
||||
#ifdef SHARED_NOTHING_DEMO_2
|
||||
std::mutex Config::m_bulkRoot_lk;
|
||||
boost::mutex Config::m_bulkRoot_lk;
|
||||
#endif
|
||||
int Config::m_WaitPeriod = DEFAULT_WAIT_PERIOD;
|
||||
unsigned Config::m_FilesPerColumnPartition = DEFAULT_FILES_PER_COLUMN_PARTITION;
|
||||
@ -86,7 +86,7 @@ string Config::m_VersionBufferDir;
|
||||
******************************************************************************/
|
||||
void Config::initConfigCache()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
}
|
||||
|
||||
@ -330,7 +330,7 @@ void Config::checkReload()
|
||||
******************************************************************************/
|
||||
size_t Config::DBRootCount()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
return m_dbRootCount;
|
||||
@ -346,7 +346,7 @@ size_t Config::DBRootCount()
|
||||
******************************************************************************/
|
||||
std::string Config::getDBRootByIdx(unsigned idx)
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
if (idx >= m_dbRootPath.size())
|
||||
@ -368,7 +368,7 @@ std::string Config::getDBRootByIdx(unsigned idx)
|
||||
******************************************************************************/
|
||||
void Config::getDBRootPathList(std::vector<std::string>& dbRootPathList)
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
dbRootPathList.clear();
|
||||
@ -385,7 +385,7 @@ void Config::getDBRootPathList(std::vector<std::string>& dbRootPathList)
|
||||
******************************************************************************/
|
||||
std::string Config::getDBRootByNum(unsigned num)
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
Config::intstrmap_t::const_iterator iter = m_dbRootPathMap.find(num);
|
||||
@ -409,7 +409,7 @@ std::string Config::getDBRootByNum(unsigned num)
|
||||
******************************************************************************/
|
||||
void Config::getRootIdList(std::vector<uint16_t>& rootIds)
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
rootIds = m_dbRootId;
|
||||
@ -425,7 +425,7 @@ void Config::getRootIdList(std::vector<uint16_t>& rootIds)
|
||||
******************************************************************************/
|
||||
std::string Config::getBulkRoot()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
return m_bulkRoot;
|
||||
@ -435,7 +435,7 @@ std::string Config::getBulkRoot()
|
||||
void Config::getSharedNothingRoot(char* ret)
|
||||
{
|
||||
string root;
|
||||
std::unique_lock lk(m_bulkRoot_lk);
|
||||
boost::mutex::scoped_lock lk(m_bulkRoot_lk);
|
||||
|
||||
root = config::Config::makeConfig()->getConfig("WriteEngine", "SharedNothingRoot");
|
||||
strncpy(ret, root.c_str(), FILE_NAME_SIZE);
|
||||
@ -452,7 +452,7 @@ void Config::getSharedNothingRoot(char* ret)
|
||||
******************************************************************************/
|
||||
int Config::getWaitPeriod()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
return m_WaitPeriod;
|
||||
@ -468,7 +468,7 @@ int Config::getWaitPeriod()
|
||||
******************************************************************************/
|
||||
unsigned Config::getFilesPerColumnPartition()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
return m_FilesPerColumnPartition;
|
||||
@ -484,7 +484,7 @@ unsigned Config::getFilesPerColumnPartition()
|
||||
******************************************************************************/
|
||||
unsigned Config::getExtentsPerSegmentFile()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
return m_ExtentsPerSegmentFile;
|
||||
@ -507,7 +507,7 @@ unsigned Config::getExtentsPerSegmentFile()
|
||||
******************************************************************************/
|
||||
int Config::getBulkProcessPriority()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
return m_BulkProcessPriority;
|
||||
@ -521,7 +521,7 @@ int Config::getBulkProcessPriority()
|
||||
******************************************************************************/
|
||||
std::string Config::getBulkRollbackDir()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
return m_BulkRollbackDir;
|
||||
@ -535,7 +535,7 @@ std::string Config::getBulkRollbackDir()
|
||||
******************************************************************************/
|
||||
bool Config::getFastDelete()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
return m_FastDelete;
|
||||
@ -549,7 +549,7 @@ bool Config::getFastDelete()
|
||||
******************************************************************************/
|
||||
unsigned Config::getMaxFileSystemDiskUsage()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
return m_MaxFileSystemDiskUsage;
|
||||
@ -564,7 +564,7 @@ unsigned Config::getMaxFileSystemDiskUsage()
|
||||
******************************************************************************/
|
||||
unsigned Config::getNumCompressedPadBlks()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
return m_NumCompressedPadBlks;
|
||||
@ -578,7 +578,7 @@ unsigned Config::getNumCompressedPadBlks()
|
||||
******************************************************************************/
|
||||
bool Config::getParentOAMModuleFlag()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
return m_ParentOAMModuleFlag;
|
||||
@ -592,7 +592,7 @@ bool Config::getParentOAMModuleFlag()
|
||||
******************************************************************************/
|
||||
std::string Config::getLocalModuleType()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
return m_LocalModuleType;
|
||||
@ -606,7 +606,7 @@ std::string Config::getLocalModuleType()
|
||||
******************************************************************************/
|
||||
uint16_t Config::getLocalModuleID()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
return m_LocalModuleID;
|
||||
@ -622,7 +622,7 @@ uint16_t Config::getLocalModuleID()
|
||||
******************************************************************************/
|
||||
std::string Config::getVBRoot()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
checkReload();
|
||||
|
||||
return m_VersionBufferDir;
|
||||
@ -639,7 +639,7 @@ std::string Config::getVBRoot()
|
||||
******************************************************************************/
|
||||
bool Config::hasLocalDBRootListChanged()
|
||||
{
|
||||
std::unique_lock lk(fCacheLock);
|
||||
boost::mutex::scoped_lock lk(fCacheLock);
|
||||
|
||||
if (fDBRootChangeCount > 0)
|
||||
{
|
||||
|
@ -182,9 +182,9 @@ class Config
|
||||
static std::string m_bulkRoot; // root path for bulk operation
|
||||
static unsigned long fDBRootChangeCount; // track recent DBRoot changes
|
||||
static time_t fCacheTime; // timestamp associated w/cache
|
||||
static std::mutex fCacheLock; // mutex for m_dbRoot sync
|
||||
static boost::mutex fCacheLock; // mutex for m_dbRoot sync
|
||||
#ifdef SHARED_NOTHING_DEMO_2
|
||||
static std::mutex m_bulkRoot_lk; // mutex for m_bulkRoot sync
|
||||
static boost::mutex m_bulkRoot_lk; // mutex for m_bulkRoot sync
|
||||
#endif
|
||||
static int m_WaitPeriod; // secs to wait for transaction
|
||||
static unsigned m_FilesPerColumnPartition; //# seg files per partition
|
||||
|
@ -474,7 +474,7 @@ void DBRootExtentTracker::logFirstDBRootSelection() const
|
||||
bool DBRootExtentTracker::nextSegFile(uint16_t& dbRoot, uint32_t& partition, uint16_t& segment, HWM& localHwm,
|
||||
BRM::LBID_t& startLbid)
|
||||
{
|
||||
std::unique_lock lock(fDBRootExtTrkMutex);
|
||||
boost::mutex::scoped_lock lock(fDBRootExtTrkMutex);
|
||||
|
||||
fCurrentDBRootIdx++;
|
||||
|
||||
@ -515,7 +515,7 @@ bool DBRootExtentTracker::nextSegFile(uint16_t& dbRoot, uint32_t& partition, uin
|
||||
|
||||
const std::vector<DBRootExtentInfo>& DBRootExtentTracker::getDBRootExtentList()
|
||||
{
|
||||
std::unique_lock lock(fDBRootExtTrkMutex);
|
||||
boost::mutex::scoped_lock lock(fDBRootExtTrkMutex);
|
||||
return fDBRootExtentList;
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "we_type.h"
|
||||
@ -185,7 +184,7 @@ class DBRootExtentTracker
|
||||
*/
|
||||
inline int getCurrentDBRootIdx()
|
||||
{
|
||||
std::unique_lock lock(fDBRootExtTrkMutex);
|
||||
boost::mutex::scoped_lock lock(fDBRootExtTrkMutex);
|
||||
return fCurrentDBRootIdx;
|
||||
}
|
||||
|
||||
@ -200,7 +199,7 @@ class DBRootExtentTracker
|
||||
OID fOID; // applicable colunn OID
|
||||
long long fBlksPerExtent; // blocks per extent for fOID
|
||||
Log* fLog; // logger
|
||||
std::mutex fDBRootExtTrkMutex; // mutex to access fDBRootExtentList
|
||||
boost::mutex fDBRootExtTrkMutex; // mutex to access fDBRootExtentList
|
||||
int fCurrentDBRootIdx; // Index into fDBRootExtentList,
|
||||
// DBRoot where current extent is
|
||||
// being added
|
||||
|
@ -58,9 +58,9 @@ using namespace idbdatafile;
|
||||
|
||||
namespace WriteEngine
|
||||
{
|
||||
/*static*/ std::mutex FileOp::m_createDbRootMutexes;
|
||||
/*static*/ std::mutex FileOp::m_mkdirMutex;
|
||||
/*static*/ std::map<int, std::mutex> FileOp::m_DbRootAddExtentMutexes;
|
||||
/*static*/ boost::mutex FileOp::m_createDbRootMutexes;
|
||||
/*static*/ boost::mutex FileOp::m_mkdirMutex;
|
||||
/*static*/ std::map<int, boost::mutex> FileOp::m_DbRootAddExtentMutexes;
|
||||
// in 1 call to fwrite(), during initialization
|
||||
|
||||
// StopWatch timer;
|
||||
@ -116,7 +116,7 @@ void FileOp::closeFile(IDBDataFile* pFile) const
|
||||
***********************************************************/
|
||||
int FileOp::createDir(const char* dirName, mode_t mode) const
|
||||
{
|
||||
std::unique_lock lk(m_mkdirMutex);
|
||||
boost::mutex::scoped_lock lk(m_mkdirMutex);
|
||||
int rc = IDBPolicy::mkdir(dirName);
|
||||
|
||||
if (rc != 0)
|
||||
@ -993,7 +993,7 @@ int FileOp::initColumnExtent(IDBDataFile* pFile, uint16_t dbRoot, int nBlocks, c
|
||||
Stats::startParseEvent(WE_STATS_WAIT_TO_CREATE_COL_EXTENT);
|
||||
|
||||
#endif
|
||||
std::unique_lock lk(m_DbRootAddExtentMutexes[dbRoot]);
|
||||
boost::mutex::scoped_lock lk(m_DbRootAddExtentMutexes[dbRoot]);
|
||||
#ifdef PROFILE
|
||||
|
||||
if (bExpandExtent)
|
||||
@ -1714,7 +1714,7 @@ int FileOp::initDctnryExtent(IDBDataFile* pFile, uint16_t dbRoot, int nBlocks, u
|
||||
Stats::startParseEvent(WE_STATS_WAIT_TO_CREATE_DCT_EXTENT);
|
||||
#endif
|
||||
|
||||
std::unique_lock lk(m_DbRootAddExtentMutexes[dbRoot]);
|
||||
boost::mutex::scoped_lock lk(m_DbRootAddExtentMutexes[dbRoot]);
|
||||
|
||||
#ifdef PROFILE
|
||||
if (bExpandExtent)
|
||||
@ -1800,7 +1800,7 @@ int FileOp::initDctnryExtent(IDBDataFile* pFile, uint16_t dbRoot, int nBlocks, u
|
||||
/* static */
|
||||
void FileOp::initDbRootExtentMutexes()
|
||||
{
|
||||
std::unique_lock lk(m_createDbRootMutexes);
|
||||
boost::mutex::scoped_lock lk(m_createDbRootMutexes);
|
||||
|
||||
if (m_DbRootAddExtentMutexes.size() == 0)
|
||||
{
|
||||
|
@ -453,13 +453,13 @@ class FileOp : public BlockOp, public WeUIDGID
|
||||
bool m_isFix;
|
||||
|
||||
// protect creation of m_DbRootAddExtentMutexes
|
||||
static std::mutex m_createDbRootMutexes;
|
||||
static boost::mutex m_createDbRootMutexes;
|
||||
|
||||
// Mutexes used to serialize extent creation within each DBRoot
|
||||
static std::map<int, std::mutex> m_DbRootAddExtentMutexes;
|
||||
static std::map<int, boost::mutex> m_DbRootAddExtentMutexes;
|
||||
|
||||
// protect race condition in creating directories
|
||||
static std::mutex m_mkdirMutex;
|
||||
static boost::mutex m_mkdirMutex;
|
||||
|
||||
char* m_buffer; // buffer used with setvbuf()
|
||||
};
|
||||
|
@ -108,7 +108,7 @@ void Log::logMsg(const char* msg, int code, MsgLevel level)
|
||||
{
|
||||
// log to log file and error log file within scope of mutex lock.
|
||||
// logSyslog uses SimpleSyslog which has it's own lock.
|
||||
std::unique_lock lk(m_WriteLockMutex);
|
||||
boost::mutex::scoped_lock lk(m_WriteLockMutex);
|
||||
|
||||
m_errLogFile << oss.str() << std::endl;
|
||||
m_logFile << oss.str() << std::endl;
|
||||
@ -128,7 +128,7 @@ void Log::logMsg(const char* msg, int code, MsgLevel level)
|
||||
if ((level != MSGLVL_INFO2) || (m_bConsoleOutput))
|
||||
formatMsg(msg, level, oss2);
|
||||
|
||||
std::unique_lock lk(m_WriteLockMutex);
|
||||
boost::mutex::scoped_lock lk(m_WriteLockMutex);
|
||||
|
||||
m_logFile << oss.str() << std::endl;
|
||||
|
||||
|
@ -99,7 +99,7 @@ class Log : public WEObj
|
||||
std::ofstream m_logFile; // log file stream
|
||||
std::ofstream m_errLogFile; // error log file stream
|
||||
|
||||
std::mutex m_WriteLockMutex; // logging mutex
|
||||
boost::mutex m_WriteLockMutex; // logging mutex
|
||||
};
|
||||
|
||||
} // namespace WriteEngine
|
||||
|
@ -663,7 +663,7 @@ bool RBMetaWriter::backupDctnryHWMChunk(OID dctnryOID, uint16_t dbRoot, uint32_t
|
||||
|
||||
{
|
||||
// Use scoped lock to perform "find"
|
||||
std::unique_lock lock(fRBChunkDctnryMutex);
|
||||
boost::mutex::scoped_lock lock(fRBChunkDctnryMutex);
|
||||
|
||||
if ((fLog) && (fLog->isDebug(DEBUG_1)))
|
||||
printDctnryChunkList(chunkInfo, "when searching ");
|
||||
@ -705,7 +705,7 @@ bool RBMetaWriter::backupDctnryHWMChunk(OID dctnryOID, uint16_t dbRoot, uint32_t
|
||||
|
||||
{
|
||||
// Use scoped lock to perform "erase"
|
||||
std::unique_lock lock(fRBChunkDctnryMutex);
|
||||
boost::mutex::scoped_lock lock(fRBChunkDctnryMutex);
|
||||
fRBChunkDctnrySet.erase(chunkInfoFound);
|
||||
|
||||
if ((fLog) && (fLog->isDebug(DEBUG_1)))
|
||||
|
@ -34,8 +34,7 @@
|
||||
#include <set>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
|
||||
#include "we_type.h"
|
||||
#include "brmtypes.h"
|
||||
@ -315,7 +314,7 @@ class RBMetaWriter : public WeUIDGID
|
||||
Log* fLog; // import log file
|
||||
bool fCreatedSubDir; // has subdir path been created
|
||||
RBChunkSet fRBChunkDctnrySet; // Dctnry HWM chunk info
|
||||
std::mutex fRBChunkDctnryMutex; // Mutex lock for RBChunkSet
|
||||
boost::mutex fRBChunkDctnryMutex; // Mutex lock for RBChunkSet
|
||||
OID fTableOID; // OID of relevant table
|
||||
std::string fTableName; // Name of relevant table
|
||||
};
|
||||
|
@ -69,7 +69,7 @@ void SimpleSysLog::logMsg(const logging::Message::Args& msgArgs, logging::LOG_TY
|
||||
logging::Message m(msgId);
|
||||
m.format(msgArgs);
|
||||
|
||||
std::unique_lock lk(fWriteLockMutex);
|
||||
boost::mutex::scoped_lock lk(fWriteLockMutex);
|
||||
|
||||
switch (logType)
|
||||
{
|
||||
|
@ -66,7 +66,7 @@ class SimpleSysLog
|
||||
|
||||
static SimpleSysLog* fSysLogger;
|
||||
logging::LoggingID fLoggingID;
|
||||
std::mutex fWriteLockMutex; // logging mutex
|
||||
boost::mutex fWriteLockMutex; // logging mutex
|
||||
};
|
||||
|
||||
#undef EXPORT
|
||||
|
@ -29,8 +29,8 @@ namespace WriteEngine
|
||||
{
|
||||
#ifdef PROFILE
|
||||
/* static */ bool Stats::fProfiling = false;
|
||||
/* static */ std::mutex Stats::fRegisterReaderMutex;
|
||||
/* static */ std::mutex Stats::fRegisterParseMutex;
|
||||
/* static */ boost::mutex Stats::fRegisterReaderMutex;
|
||||
/* static */ boost::mutex Stats::fRegisterParseMutex;
|
||||
/* static */ std::vector<pthread_t> Stats::fReadProfThreads;
|
||||
/* static */ std::vector<pthread_t> Stats::fParseProfThreads;
|
||||
/* static */ std::vector<logging::StopWatch> Stats::fReadStopWatch;
|
||||
@ -111,7 +111,7 @@ void Stats::enableProfiling(int nReadThreads, int nParseThreads)
|
||||
***********************************************************/
|
||||
void Stats::registerReadProfThread()
|
||||
{
|
||||
std::unique_lock lk(fRegisterReaderMutex);
|
||||
boost::mutex::scoped_lock lk(fRegisterReaderMutex);
|
||||
|
||||
fReadProfThreads.push_back(pthread_self());
|
||||
logging::StopWatch readStopWatch;
|
||||
@ -128,7 +128,7 @@ void Stats::registerReadProfThread()
|
||||
***********************************************************/
|
||||
void Stats::registerParseProfThread()
|
||||
{
|
||||
std::unique_lock lk(fRegisterParseMutex);
|
||||
boost::mutex::scoped_lock lk(fRegisterParseMutex);
|
||||
|
||||
fParseProfThreads.push_back(pthread_self());
|
||||
logging::StopWatch parseStopWatch;
|
||||
|
@ -24,8 +24,7 @@
|
||||
#pragma once
|
||||
#include <we_obj.h>
|
||||
#ifdef PROFILE
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include "stopwatch.h"
|
||||
#endif
|
||||
|
||||
@ -160,10 +159,10 @@ class Stats
|
||||
static bool fProfiling; // Is profiling enabled
|
||||
|
||||
// Protect concurrent addition of Readers
|
||||
static std::mutex fRegisterReaderMutex;
|
||||
static boost::mutex fRegisterReaderMutex;
|
||||
|
||||
// Protect concurrent addition of Parsers
|
||||
static std::mutex fRegisterParseMutex;
|
||||
static boost::mutex fRegisterParseMutex;
|
||||
|
||||
// Read threads to be profiled
|
||||
static std::vector<pthread_t> fReadProfThreads;
|
||||
|
Reference in New Issue
Block a user