1
0
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:
Leonid Fedorov
2023-04-22 00:42:45 +03:00
committed by GitHub
parent 3ce19abdae
commit f916e64927
245 changed files with 1261 additions and 2007 deletions

View File

@ -32,8 +32,8 @@
#endif
using namespace std;
#include <boost/thread/mutex.hpp>
using namespace boost;
#include <map>
#include <mutex>
#include "messagequeue.h"
#include "bytestream.h"
@ -225,7 +225,7 @@ void WEClients::Setup()
string fServer(buff);
boost::shared_ptr<MessageQueueClient> cl(new MessageQueueClient(fServer, rm->getConfig()));
boost::shared_ptr<boost::mutex> nl(new boost::mutex());
boost::shared_ptr<std::mutex> nl(new std::mutex());
// Bug 5224. Take out the retrys. If connection fails, we assume the server is down.
try
@ -355,7 +355,7 @@ void WEClients::Listen(boost::shared_ptr<MessageQueueClient> client, uint32_t co
Error:
// error condition! push 0 length bs to messagequeuemap and
// eventually let jobstep error out.
boost::mutex::scoped_lock lk(fMlock);
std::unique_lock lk(fMlock);
MessageQueueMap::iterator map_tok;
sbs.reset(new ByteStream(0));
@ -371,7 +371,7 @@ Error:
// reset the pmconnection map
{
boost::mutex::scoped_lock onErrLock(fOnErrMutex);
std::unique_lock onErrLock(fOnErrMutex);
string moduleName = client->moduleName();
ClientList::iterator itor = fPmConnections.begin();
@ -396,13 +396,13 @@ void WEClients::addQueue(uint32_t key)
{
bool b;
boost::mutex* lock = new boost::mutex();
condition* cond = new condition();
std::mutex* lock = new std::mutex();
std::condition_variable* cond = new std::condition_variable();
boost::shared_ptr<MQE> mqe(new MQE(pmCount));
mqe->queue = WESMsgQueue(lock, cond);
boost::mutex::scoped_lock lk(fMlock);
std::unique_lock lk(fMlock);
b = fSessionMessages.insert(pair<uint32_t, boost::shared_ptr<MQE> >(key, mqe)).second;
if (!b)
@ -415,7 +415,7 @@ void WEClients::addQueue(uint32_t key)
void WEClients::removeQueue(uint32_t key)
{
boost::mutex::scoped_lock lk(fMlock);
std::unique_lock lk(fMlock);
MessageQueueMap::iterator map_tok = fSessionMessages.find(key);
if (map_tok == fSessionMessages.end())
@ -428,7 +428,7 @@ void WEClients::removeQueue(uint32_t key)
void WEClients::shutdownQueue(uint32_t key)
{
boost::mutex::scoped_lock lk(fMlock);
std::unique_lock lk(fMlock);
MessageQueueMap::iterator map_tok = fSessionMessages.find(key);
if (map_tok == fSessionMessages.end())
@ -443,7 +443,7 @@ void WEClients::read(uint32_t key, SBS& bs)
boost::shared_ptr<MQE> mqe;
// Find the StepMsgQueueList for this session
boost::mutex::scoped_lock lk(fMlock);
std::unique_lock lk(fMlock);
MessageQueueMap::iterator map_tok = fSessionMessages.find(key);
if (map_tok == fSessionMessages.end())
@ -521,7 +521,7 @@ void WEClients::addDataToOutput(SBS sbs, uint32_t connIndex)
*sbs >> uniqueId;
boost::shared_ptr<MQE> mqe;
boost::mutex::scoped_lock lk(fMlock);
std::unique_lock lk(fMlock);
MessageQueueMap::iterator map_tok = fSessionMessages.find(uniqueId);
if (map_tok == fSessionMessages.end())