1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +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

@ -56,7 +56,7 @@ class ThreadSafeQueue
*
* @warning this class takes ownership of the passed-in pointers.
*/
ThreadSafeQueue(std::mutex* pimplLock = 0, std::condition_variable* pimplCond = 0)
ThreadSafeQueue(boost::mutex* pimplLock = 0, boost::condition* pimplCond = 0)
: fShutdown(false), bytes(0), zeroCount(0)
{
fPimplLock.reset(pimplLock);
@ -90,7 +90,7 @@ class ThreadSafeQueue
if (fPimplLock == 0 || fPimplCond == 0)
throw std::runtime_error("TSQ: front() const: no sync!");
std::unique_lock lk(*fPimplLock);
boost::mutex::scoped_lock lk(*fPimplLock);
if (fImpl.empty())
{
@ -116,7 +116,7 @@ class ThreadSafeQueue
if (fPimplLock == 0 || fPimplCond == 0)
throw std::runtime_error("TSQ: front(): no sync!");
std::unique_lock lk(*fPimplLock);
boost::mutex::scoped_lock lk(*fPimplLock);
if (fImpl.empty())
{
@ -146,7 +146,7 @@ class ThreadSafeQueue
if (fShutdown)
return ret;
std::unique_lock lk(*fPimplLock);
boost::mutex::scoped_lock lk(*fPimplLock);
fImpl.push(v);
bytes += v->lengthWithHdrOverhead();
fPimplCond->notify_one();
@ -170,7 +170,7 @@ class ThreadSafeQueue
return ret;
}
std::unique_lock lk(*fPimplLock);
boost::mutex::scoped_lock lk(*fPimplLock);
if (out != NULL)
{
@ -221,7 +221,7 @@ class ThreadSafeQueue
if (fShutdown)
return ret;
std::unique_lock lk(*fPimplLock);
boost::mutex::scoped_lock lk(*fPimplLock);
curSize = fImpl.size();
if (curSize < min)
@ -271,7 +271,7 @@ class ThreadSafeQueue
if (fPimplLock == 0)
throw std::runtime_error("TSQ: empty(): no sync!");
std::unique_lock lk(*fPimplLock);
boost::mutex::scoped_lock lk(*fPimplLock);
return fImpl.empty();
}
/** @brief how many items are in the queue
@ -284,7 +284,7 @@ class ThreadSafeQueue
if (fPimplLock == 0)
throw std::runtime_error("TSQ: size(): no sync!");
std::unique_lock lk(*fPimplLock);
boost::mutex::scoped_lock lk(*fPimplLock);
ret.size = bytes;
ret.count = fImpl.size();
return ret;
@ -309,7 +309,7 @@ class ThreadSafeQueue
if (fPimplLock == 0)
throw std::runtime_error("TSQ: clear(): no sync!");
std::unique_lock lk(*fPimplLock);
boost::mutex::scoped_lock lk(*fPimplLock);
while (!fImpl.empty())
fImpl.pop();
@ -320,8 +320,8 @@ class ThreadSafeQueue
private:
typedef std::queue<T> impl_type;
typedef boost::shared_ptr<std::mutex> SPBM;
typedef boost::shared_ptr<std::condition_variable> SPBC;
typedef boost::shared_ptr<boost::mutex> SPBM;
typedef boost::shared_ptr<boost::condition> SPBC;
// defaults okay
// ThreadSafeQueue<T>(const ThreadSafeQueue<T>& rhs);