diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-03-06 17:35:09 -0500 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-03-07 08:58:38 -0500 |
commit | fa70ccc6c4e304646b4610228f3975b3a9762643 (patch) | |
tree | 6e71660d0e31639aff2638332fc273a0198956ab /src/scheduler.h | |
parent | 3516a31eaa7714a815e0346625ae096f281d3d9e (diff) |
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.h')
-rw-r--r-- | src/scheduler.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/scheduler.h b/src/scheduler.h index 4d5aa3068e..71d1726c4f 100644 --- a/src/scheduler.h +++ b/src/scheduler.h @@ -86,9 +86,9 @@ private: mutable Mutex newTaskMutex; std::condition_variable newTaskScheduled; std::multimap<std::chrono::system_clock::time_point, Function> taskQueue GUARDED_BY(newTaskMutex); - int nThreadsServicingQueue GUARDED_BY(newTaskMutex); - bool stopRequested GUARDED_BY(newTaskMutex); - bool stopWhenEmpty GUARDED_BY(newTaskMutex); + int nThreadsServicingQueue GUARDED_BY(newTaskMutex){0}; + bool stopRequested GUARDED_BY(newTaskMutex){false}; + bool stopWhenEmpty GUARDED_BY(newTaskMutex){false}; bool shouldStop() const EXCLUSIVE_LOCKS_REQUIRED(newTaskMutex) { return stopRequested || (stopWhenEmpty && taskQueue.empty()); } }; |