diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-02-17 00:57:54 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-02-17 00:57:54 +0100 |
| commit | c3ce1bf707fb5308f4b96cb96ed6e8d29335a319 (patch) | |
| tree | 5dcf2fefc25e53201b5a3f98d41772b03f0051d4 | |
| parent | fa85cc6352a2f25bdd1d4421c9490f9fca266e04 (diff) | |
Keep Waker around for longer so it works better (#2184).
| -rw-r--r-- | src/lib/encode_server.cc | 3 | ||||
| -rw-r--r-- | src/lib/encode_server.h | 8 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/encode_server.cc b/src/lib/encode_server.cc index 24ba5bc45..cd471d171 100644 --- a/src/lib/encode_server.cc +++ b/src/lib/encode_server.cc @@ -336,8 +336,7 @@ EncodeServer::handle (shared_ptr<Socket> socket) { boost::mutex::scoped_lock lock (_mutex); - Waker waker; - waker.nudge (); + _waker.nudge (); /* Wait until the queue has gone down a bit */ while (_queue.size() >= _worker_threads.size() * 2 && !_terminate) { diff --git a/src/lib/encode_server.h b/src/lib/encode_server.h index 6e24a1984..0ca60f3f3 100644 --- a/src/lib/encode_server.h +++ b/src/lib/encode_server.h @@ -28,16 +28,17 @@ */ -#include "server.h" +#include "cross.h" #include "exception_store.h" -#include <boost/thread.hpp> +#include "server.h" #include <boost/asio.hpp> +#include <boost/thread.hpp> #include <boost/thread/condition.hpp> #include <string> -class Socket; class Log; +class Socket; /** @class EncodeServer @@ -65,6 +66,7 @@ private: boost::condition _empty_condition; bool _verbose; int _num_threads; + Waker _waker; struct Broadcast { |
