diff options
| author | Matt Corallo <[email protected]> | 2017-05-22 16:01:52 -0400 |
|---|---|---|
| committer | Matt Corallo <[email protected]> | 2017-05-22 16:01:52 -0400 |
| commit | 888cce57a67c901b89c86cc645f275071d021285 (patch) | |
| tree | 14106f6de281a105033abba873dc6007c7be7180 /src/scheduler.cpp | |
| parent | Add internal method to add new random data to our internal RNG state (diff) | |
| download | discoin-888cce57a67c901b89c86cc645f275071d021285.tar.xz discoin-888cce57a67c901b89c86cc645f275071d021285.zip | |
Add perf counter data to GetStrongRandBytes state in scheduler
Diffstat (limited to 'src/scheduler.cpp')
| -rw-r--r-- | src/scheduler.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/scheduler.cpp b/src/scheduler.cpp index 0c1cfa271..923ba2c23 100644 --- a/src/scheduler.cpp +++ b/src/scheduler.cpp @@ -4,6 +4,7 @@ #include "scheduler.h" +#include "random.h" #include "reverselock.h" #include <assert.h> @@ -39,6 +40,11 @@ void CScheduler::serviceQueue() // is called. while (!shouldStop()) { try { + if (!shouldStop() && taskQueue.empty()) { + reverse_lock<boost::unique_lock<boost::mutex> > rlock(lock); + // Use this chance to get a tiny bit more entropy + RandAddSeedSleep(); + } while (!shouldStop() && taskQueue.empty()) { // Wait until there is something to do. newTaskScheduled.wait(lock); |