diff options
| author | Matt Corallo <[email protected]> | 2017-07-10 21:08:19 -0400 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2017-07-10 21:08:19 -0400 |
| commit | 1f668b646806f94acd851acdbd9939c24e0492d3 (patch) | |
| tree | c771b63f06207f18c7956ca5c40d2924972ba92b /src/scheduler.h | |
| parent | Flush CValidationInterface callbacks prior to destruction (diff) | |
| download | discoin-1f668b646806f94acd851acdbd9939c24e0492d3.tar.xz discoin-1f668b646806f94acd851acdbd9939c24e0492d3.zip | |
Expose if CScheduler is being serviced, assert its not in EmptyQueue
Diffstat (limited to 'src/scheduler.h')
| -rw-r--r-- | src/scheduler.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/scheduler.h b/src/scheduler.h index 6a079f774..0365d668b 100644 --- a/src/scheduler.h +++ b/src/scheduler.h @@ -71,6 +71,9 @@ public: size_t getQueueInfo(boost::chrono::system_clock::time_point &first, boost::chrono::system_clock::time_point &last) const; + // Returns true if there are threads actively running in serviceQueue() + bool AreThreadsServicingQueue() const; + private: std::multimap<boost::chrono::system_clock::time_point, Function> taskQueue; boost::condition_variable newTaskScheduled; @@ -103,6 +106,7 @@ public: void AddToProcessQueue(std::function<void (void)> func); // Processes all remaining queue members on the calling thread, blocking until queue is empty + // Must be called after the CScheduler has no remaining processing threads! void EmptyQueue(); }; |