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
No boost condition (#2822)
This patch replaces boost primitives with stdlib counterparts.
This commit is contained in:
@ -26,7 +26,8 @@
|
||||
#include <ctime>
|
||||
|
||||
//#define SERIALIZE_DDL_DML_CPIMPORT 1
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <boost/scoped_ptr.hpp>
|
||||
#include <boost/scoped_array.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
@ -60,8 +61,8 @@ using namespace WriteEngine;
|
||||
#include "querytele.h"
|
||||
using namespace querytele;
|
||||
|
||||
extern boost::mutex mute;
|
||||
extern boost::condition_variable cond;
|
||||
extern std::mutex mute;
|
||||
extern std::condition_variable cond;
|
||||
|
||||
#define MCOL_140 // Undefine to test VSS for out of order transactions
|
||||
|
||||
@ -75,16 +76,16 @@ namespace dmlprocessor
|
||||
// Map to store the package handler objects so we can set flags during execution
|
||||
// for things like ctrl+c
|
||||
DMLProcessor::PackageHandlerMap_t DMLProcessor::packageHandlerMap;
|
||||
boost::mutex DMLProcessor::packageHandlerMapLock;
|
||||
std::mutex DMLProcessor::packageHandlerMapLock;
|
||||
|
||||
// Map to store the BatchInsertProc object
|
||||
std::map<uint32_t, BatchInsertProc*> DMLProcessor::batchinsertProcessorMap;
|
||||
boost::mutex DMLProcessor::batchinsertProcessorMapLock;
|
||||
std::mutex DMLProcessor::batchinsertProcessorMapLock;
|
||||
|
||||
// MCOL-140 Map to hold table oids for tables being changed.
|
||||
std::map<uint32_t, PackageHandler::tableAccessQueue_t> PackageHandler::tableOidMap;
|
||||
boost::condition_variable PackageHandler::tableOidCond;
|
||||
boost::mutex PackageHandler::tableOidMutex;
|
||||
std::condition_variable PackageHandler::tableOidCond;
|
||||
std::mutex PackageHandler::tableOidMutex;
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// A thread to periodically call dbrm to see if a user is
|
||||
@ -145,7 +146,7 @@ struct CancellationThread
|
||||
// Tell any active processors to stop working and return an error
|
||||
// The front end will respond with a ROLLBACK command.
|
||||
// Mark all active processors to rollback
|
||||
boost::mutex::scoped_lock lk2(DMLProcessor::packageHandlerMapLock);
|
||||
std::unique_lock lk2(DMLProcessor::packageHandlerMapLock);
|
||||
|
||||
for (phIter = DMLProcessor::packageHandlerMap.begin();
|
||||
phIter != DMLProcessor::packageHandlerMap.end(); ++phIter)
|
||||
@ -365,7 +366,7 @@ int PackageHandler::synchTableAccess(dmlpackage::CalpontDMLPackage* dmlPackage)
|
||||
{
|
||||
// MCOL-140 Wait for any other DML using this table.
|
||||
std::map<uint32_t, PackageHandler::tableAccessQueue_t>::iterator it;
|
||||
boost::unique_lock<boost::mutex> lock(tableOidMutex);
|
||||
std::unique_lock<std::mutex> lock(tableOidMutex);
|
||||
BRM::TxnID txnid;
|
||||
|
||||
if (fPackageType != dmlpackage::DML_COMMAND)
|
||||
@ -465,7 +466,7 @@ int PackageHandler::releaseTableAccess()
|
||||
{
|
||||
// take us out of the queue
|
||||
std::map<uint32_t, PackageHandler::tableAccessQueue_t>::iterator it;
|
||||
boost::lock_guard<boost::mutex> lock(tableOidMutex);
|
||||
boost::lock_guard<std::mutex> lock(tableOidMutex);
|
||||
|
||||
if (fTableOid == 0 || (it = tableOidMap.find(fTableOid)) == tableOidMap.end())
|
||||
{
|
||||
@ -512,7 +513,7 @@ int PackageHandler::forceReleaseTableAccess()
|
||||
// By removing the txnid from the queue, the logic after the wait in
|
||||
// synchTableAccess() will release the thread and clean up if needed.
|
||||
std::map<uint32_t, PackageHandler::tableAccessQueue_t>::iterator it;
|
||||
boost::lock_guard<boost::mutex> lock(tableOidMutex);
|
||||
boost::lock_guard<std::mutex> lock(tableOidMutex);
|
||||
|
||||
if (fTableOid == 0 || (it = tableOidMap.find(fTableOid)) == tableOidMap.end())
|
||||
{
|
||||
@ -603,7 +604,7 @@ void PackageHandler::run()
|
||||
// cout << "This is batch insert " << endl;
|
||||
BatchInsertProc* batchProcessor = NULL;
|
||||
{
|
||||
boost::mutex::scoped_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
std::unique_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
|
||||
std::map<uint32_t, BatchInsertProc*>::iterator batchIter =
|
||||
DMLProcessor::batchinsertProcessorMap.find(fSessionID);
|
||||
@ -750,7 +751,7 @@ void PackageHandler::run()
|
||||
|
||||
// remove the batch insert object
|
||||
{
|
||||
boost::mutex::scoped_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
std::unique_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
|
||||
std::map<uint32_t, BatchInsertProc*>::iterator batchIter =
|
||||
DMLProcessor::batchinsertProcessorMap.find(fSessionID);
|
||||
@ -866,7 +867,7 @@ void PackageHandler::run()
|
||||
|
||||
// remove from map
|
||||
{
|
||||
boost::mutex::scoped_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
std::unique_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
std::map<uint32_t, BatchInsertProc*>::iterator batchIter =
|
||||
DMLProcessor::batchinsertProcessorMap.find(fSessionID);
|
||||
|
||||
@ -911,7 +912,7 @@ void PackageHandler::run()
|
||||
logger.logMessage(LOG_TYPE_DEBUG, msg, logid);
|
||||
// remove from map
|
||||
{
|
||||
boost::mutex::scoped_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
std::unique_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
std::map<uint32_t, BatchInsertProc*>::iterator batchIter =
|
||||
DMLProcessor::batchinsertProcessorMap.find(fSessionID);
|
||||
|
||||
@ -1163,7 +1164,7 @@ void PackageHandler::run()
|
||||
// If we remove it after sending the results, it's possible for a commit
|
||||
// or rollback be sent and get processed before it is removed, and that
|
||||
// will fail.
|
||||
boost::mutex::scoped_lock lk2(DMLProcessor::packageHandlerMapLock);
|
||||
std::unique_lock lk2(DMLProcessor::packageHandlerMapLock);
|
||||
DMLProcessor::packageHandlerMap.erase(getSessionID());
|
||||
lk2.unlock();
|
||||
|
||||
@ -1452,7 +1453,7 @@ void DMLProcessor::operator()()
|
||||
if (insertPkg.get_isBatchInsert() && insertPkg.get_Logending())
|
||||
{
|
||||
{
|
||||
boost::mutex::scoped_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
std::unique_lock lk(DMLProcessor::batchinsertProcessorMapLock);
|
||||
std::map<uint32_t, BatchInsertProc*>::iterator batchIter =
|
||||
DMLProcessor::batchinsertProcessorMap.find(sessionID);
|
||||
|
||||
@ -1502,7 +1503,7 @@ void DMLProcessor::operator()()
|
||||
// This mechanism may prove useful for other things, so the above
|
||||
// comment may change.
|
||||
{
|
||||
boost::mutex::scoped_lock lk2(DMLProcessor::packageHandlerMapLock);
|
||||
std::unique_lock lk2(DMLProcessor::packageHandlerMapLock);
|
||||
DMLProcessor::PackageHandlerMap_t::iterator phIter = packageHandlerMap.find(sessionID);
|
||||
|
||||
if (phIter != packageHandlerMap.end())
|
||||
@ -1740,7 +1741,7 @@ void DMLProcessor::operator()()
|
||||
sessionID, txnid.id, fDbrm, fQtc, csc));
|
||||
// We put the packageHandler into a map so that if we receive a
|
||||
// message to affect the previous command, we can find it.
|
||||
boost::mutex::scoped_lock lk2(DMLProcessor::packageHandlerMapLock, boost::defer_lock);
|
||||
std::unique_lock lk2(DMLProcessor::packageHandlerMapLock, std::defer_lock);
|
||||
|
||||
lk2.lock();
|
||||
packageHandlerMap[sessionID] = php;
|
||||
@ -1782,7 +1783,7 @@ void DMLProcessor::operator()()
|
||||
fIos, bs1, packageType, fEC, fConcurrentSupport, maxDeleteRows, sessionID, 0, fDbrm, fQtc, csc));
|
||||
// We put the packageHandler into a map so that if we receive a
|
||||
// message to affect the previous command, we can find it.
|
||||
boost::mutex::scoped_lock lk2(DMLProcessor::packageHandlerMapLock, boost::defer_lock);
|
||||
std::unique_lock lk2(DMLProcessor::packageHandlerMapLock, std::defer_lock);
|
||||
|
||||
lk2.lock();
|
||||
packageHandlerMap[sessionID] = php;
|
||||
|
Reference in New Issue
Block a user