1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

Revert "No boost condition (#2822)" (#2828)

This reverts commit f916e64927.
This commit is contained in:
Roman Nozdrin
2023-04-22 13:49:50 +01:00
committed by GitHub
parent f916e64927
commit 4fe9cd64a3
245 changed files with 2007 additions and 1261 deletions

View File

@@ -30,7 +30,7 @@
using namespace std;
#include <boost/thread.hpp>
#include <condition_variable>
#include <boost/thread/condition.hpp>
#include <boost/uuid/uuid_io.hpp>
using namespace boost;
@@ -79,7 +79,7 @@ using namespace querytele;
#include "pseudocolumn.h"
//#define DEBUG 1
extern std::mutex fileLock_g;
extern boost::mutex fileLock_g;
namespace
{
@@ -1160,7 +1160,7 @@ void TupleBPS::serializeJoiner()
{
{
// code block to release the lock immediatly
std::unique_lock lk(serializeJoinerMutex);
boost::mutex::scoped_lock lk(serializeJoinerMutex);
more = fBPP->nextTupleJoinerMsg(*sbs);
}
#ifdef JLF_DEBUG
@@ -1175,7 +1175,7 @@ void TupleBPS::serializeJoiner()
void TupleBPS::serializeJoiner(uint32_t conn)
{
// We need this lock for TupleBPS::serializeJoiner()
std::unique_lock lk(serializeJoinerMutex);
boost::mutex::scoped_lock lk(serializeJoinerMutex);
ByteStream bs;
bool more = true;
@@ -1195,7 +1195,7 @@ void TupleBPS::prepCasualPartitioning()
uint32_t i;
int64_t min, max, seq;
int128_t bigMin, bigMax;
std::unique_lock lk(cpMutex);
boost::mutex::scoped_lock lk(cpMutex);
for (i = 0; i < scannedExtents.size(); i++)
{
@@ -1405,7 +1405,7 @@ void TupleBPS::reloadExtentLists()
void TupleBPS::run()
{
uint32_t i;
std::unique_lock lk(jlLock);
boost::mutex::scoped_lock lk(jlLock);
uint32_t retryCounter = 0;
const uint32_t retryMax = 1000; // 50s max; we've seen a 15s window so 50s should be 'safe'
const uint32_t waitInterval = 50000; // in us
@@ -1500,7 +1500,7 @@ void TupleBPS::run()
void TupleBPS::join()
{
std::unique_lock lk(jlLock);
boost::mutex::scoped_lock lk(jlLock);
if (joinRan)
return;
@@ -1512,7 +1512,7 @@ void TupleBPS::join()
if (msgsRecvd < msgsSent)
{
// wake up the sending thread, it should drain the input dl and exit
std::unique_lock<std::mutex> tplLock(tplMutex);
boost::unique_lock<boost::mutex> tplLock(tplMutex);
condvarWakeupProducer.notify_all();
tplLock.unlock();
}
@@ -1669,7 +1669,7 @@ void TupleBPS::interleaveJobs(vector<Job>* jobs) const
void TupleBPS::sendJobs(const vector<Job>& jobs)
{
uint32_t i;
std::unique_lock<std::mutex> tplLock(tplMutex, std::defer_lock);
boost::unique_lock<boost::mutex> tplLock(tplMutex, boost::defer_lock);
for (i = 0; i < jobs.size() && !cancelled(); i++)
{
@@ -2142,7 +2142,7 @@ void TupleBPS::sendPrimitiveMessages()
}
abort:
std::unique_lock<std::mutex> tplLock(tplMutex);
boost::unique_lock<boost::mutex> tplLock(tplMutex);
finishedSending = true;
condvar.notify_all();
tplLock.unlock();
@@ -2402,7 +2402,7 @@ void TupleBPS::receiveMultiPrimitiveMessages()
initializeJoinLocalDataPool(1);
vector<boost::shared_ptr<messageqcpp::ByteStream>> bsv;
std::unique_lock<std::mutex> tplLock(tplMutex, std::defer_lock);
boost::unique_lock<boost::mutex> tplLock(tplMutex, boost::defer_lock);
try
{
@@ -3393,6 +3393,7 @@ void TupleBPS::abort_nolock()
void TupleBPS::abort()
{
boost::mutex::scoped_lock scoped(boost::mutex);
abort_nolock();
}