aboutsummaryrefslogtreecommitdiff
path: root/src/scheduler.cpp
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-03-06 17:35:09 -0500
committerMarcoFalke <falke.marco@gmail.com>2020-03-07 08:58:38 -0500
commitfa70ccc6c4e304646b4610228f3975b3a9762643 (patch)
tree6e71660d0e31639aff2638332fc273a0198956ab /src/scheduler.cpp
parent3516a31eaa7714a815e0346625ae096f281d3d9e (diff)
downloadbitcoin-fa70ccc6c4e304646b4610228f3975b3a9762643.tar.xz
scheduler: Use C++11 member initialization, add shutdown assert
"Initializing the members in the declaration makes it easy to spot uninitialized ones". https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#c-data-structures
Diffstat (limited to 'src/scheduler.cpp')
-rw-r--r--src/scheduler.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/scheduler.cpp b/src/scheduler.cpp
index 7cb7754fde..67e17d074b 100644
--- a/src/scheduler.cpp
+++ b/src/scheduler.cpp
@@ -9,13 +9,14 @@
#include <assert.h>
#include <utility>
-CScheduler::CScheduler() : nThreadsServicingQueue(0), stopRequested(false), stopWhenEmpty(false)
+CScheduler::CScheduler()
{
}
CScheduler::~CScheduler()
{
assert(nThreadsServicingQueue == 0);
+ if (stopWhenEmpty) assert(taskQueue.empty());
}