summaryrefslogtreecommitdiff
path: root/src/lib/server.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-06-26 23:36:24 +0100
committerCarl Hetherington <cth@carlh.net>2014-06-26 23:36:24 +0100
commit4616b19fb5241a54c9d57f7a91bb975f41aed14b (patch)
treed067450cb12dd3629fe88ef9a578c6b1cabe7884 /src/lib/server.cc
parentf1d30fb114b3b2c6ccd8fdf5823e7cd6b26c1eef (diff)
parent20fa26ea6ecfdbecea8bb1230c8388cce3fd521f (diff)
Merge master.
Diffstat (limited to 'src/lib/server.cc')
-rw-r--r--src/lib/server.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/server.cc b/src/lib/server.cc
index 66ee2b0e3..fe792e307 100644
--- a/src/lib/server.cc
+++ b/src/lib/server.cc
@@ -79,7 +79,7 @@ Server::~Server ()
{
boost::mutex::scoped_lock lm (_worker_mutex);
_terminate = true;
- _worker_condition.notify_all ();
+ _empty_condition.notify_all ();
}
for (vector<boost::thread*>::iterator i = _worker_threads.begin(); i != _worker_threads.end(); ++i) {
@@ -139,7 +139,7 @@ Server::worker_thread ()
while (1) {
boost::mutex::scoped_lock lock (_worker_mutex);
while (_queue.empty () && !_terminate) {
- _worker_condition.wait (lock);
+ _empty_condition.wait (lock);
}
if (_terminate) {
@@ -194,7 +194,7 @@ Server::worker_thread ()
LOG_GENERAL_NC (message.str ());
}
- _worker_condition.notify_all ();
+ _full_condition.notify_all ();
}
}
@@ -291,11 +291,11 @@ Server::handle_accept (shared_ptr<Socket> socket, boost::system::error_code cons
/* Wait until the queue has gone down a bit */
while (_queue.size() >= _worker_threads.size() * 2 && !_terminate) {
- _worker_condition.wait (lock);
+ _full_condition.wait (lock);
}
_queue.push_back (socket);
- _worker_condition.notify_all ();
+ _empty_condition.notify_all ();
start_accept ();
}