aboutsummaryrefslogtreecommitdiff
path: root/src/httpserver.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-02-07 09:53:46 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2018-02-07 09:53:46 +0100
commit11e01515fe0fbc7823d4111ad6e016a02c485a78 (patch)
tree62ec46dc08c97ce9c4c619b9c9b2b2b0e5e32fed /src/httpserver.cpp
parentf94665466ed50e868c98b1a1c708ad5767727bb6 (diff)
http: Remove numThreads and ThreadCounter
The HTTP worker thread counter, as well as the RAII object that was used to maintain it, is unused now, so can be removed. Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
Diffstat (limited to 'src/httpserver.cpp')
-rw-r--r--src/httpserver.cpp23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/httpserver.cpp b/src/httpserver.cpp
index 5000b0e245..f78ce13737 100644
--- a/src/httpserver.cpp
+++ b/src/httpserver.cpp
@@ -73,30 +73,10 @@ private:
std::deque<std::unique_ptr<WorkItem>> queue;
bool running;
size_t maxDepth;
- int numThreads;
-
- /** RAII object to keep track of number of running worker threads */
- class ThreadCounter
- {
- public:
- WorkQueue &wq;
- explicit ThreadCounter(WorkQueue &w): wq(w)
- {
- std::lock_guard<std::mutex> lock(wq.cs);
- wq.numThreads += 1;
- }
- ~ThreadCounter()
- {
- std::lock_guard<std::mutex> lock(wq.cs);
- wq.numThreads -= 1;
- wq.cond.notify_all();
- }
- };
public:
explicit WorkQueue(size_t _maxDepth) : running(true),
- maxDepth(_maxDepth),
- numThreads(0)
+ maxDepth(_maxDepth)
{
}
/** Precondition: worker threads have all stopped (they have been joined).
@@ -118,7 +98,6 @@ public:
/** Thread function */
void Run()
{
- ThreadCounter count(*this);
while (true) {
std::unique_ptr<WorkItem> i;
{