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:
@ -24,7 +24,7 @@ using namespace messageqcpp;
|
||||
namespace
|
||||
{
|
||||
idbdatafile::SMComm* instance = NULL;
|
||||
std::mutex m;
|
||||
boost::mutex m;
|
||||
}; // namespace
|
||||
|
||||
namespace idbdatafile
|
||||
@ -34,7 +34,7 @@ SMComm* SMComm::get()
|
||||
if (instance)
|
||||
return instance;
|
||||
|
||||
std::unique_lock sl(m);
|
||||
boost::mutex::scoped_lock sl(m);
|
||||
|
||||
if (instance)
|
||||
return instance;
|
||||
|
@ -68,7 +68,7 @@ SocketPool::SocketPool()
|
||||
|
||||
SocketPool::~SocketPool()
|
||||
{
|
||||
std::unique_lock lock(mutex);
|
||||
boost::mutex::scoped_lock lock(mutex);
|
||||
|
||||
for (uint i = 0; i < allSockets.size(); i++)
|
||||
::close(allSockets[i]);
|
||||
@ -213,7 +213,7 @@ retry:
|
||||
|
||||
int SocketPool::getSocket()
|
||||
{
|
||||
std::unique_lock lock(mutex);
|
||||
boost::mutex::scoped_lock lock(mutex);
|
||||
int clientSocket;
|
||||
|
||||
if (freeSockets.size() == 0 && allSockets.size() < maxSockets)
|
||||
@ -253,7 +253,7 @@ int SocketPool::getSocket()
|
||||
|
||||
void SocketPool::returnSocket(const int sock)
|
||||
{
|
||||
std::unique_lock lock(mutex);
|
||||
boost::mutex::scoped_lock lock(mutex);
|
||||
// cout << "returning socket " << sock << endl;
|
||||
freeSockets.push_back(sock);
|
||||
socketAvailable.notify_one();
|
||||
@ -261,7 +261,7 @@ void SocketPool::returnSocket(const int sock)
|
||||
|
||||
void SocketPool::remoteClosed(const int sock)
|
||||
{
|
||||
std::unique_lock lock(mutex);
|
||||
boost::mutex::scoped_lock lock(mutex);
|
||||
// cout << "closing socket " << sock << endl;
|
||||
::close(sock);
|
||||
for (vector<int>::iterator i = allSockets.begin(); i != allSockets.end(); ++i)
|
||||
|
@ -20,9 +20,8 @@
|
||||
#include <deque>
|
||||
|
||||
#include <boost/utility.hpp>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <boost/thread/condition_variable.hpp>
|
||||
|
||||
#include "bytestream.h"
|
||||
|
||||
@ -47,8 +46,8 @@ class SocketPool : public boost::noncopyable
|
||||
|
||||
std::vector<int> allSockets;
|
||||
std::deque<int> freeSockets;
|
||||
std::mutex mutex;
|
||||
std::condition_variable socketAvailable;
|
||||
boost::mutex mutex;
|
||||
boost::condition_variable socketAvailable;
|
||||
uint maxSockets;
|
||||
static const uint defaultSockets = 20;
|
||||
};
|
||||
|
Reference in New Issue
Block a user