aboutsummaryrefslogtreecommitdiff
path: root/src/scheduler.cpp
diff options
context:
space:
mode:
authorMatt Corallo <git@bluematt.me>2017-05-22 16:01:52 -0400
committerMatt Corallo <git@bluematt.me>2017-05-22 16:01:52 -0400
commit888cce57a67c901b89c86cc645f275071d021285 (patch)
tree14106f6de281a105033abba873dc6007c7be7180 /src/scheduler.cpp
parent399fb8f2d0fa9cff2f461ef2c0da5b91765987f1 (diff)
downloadbitcoin-888cce57a67c901b89c86cc645f275071d021285.tar.xz
Add perf counter data to GetStrongRandBytes state in scheduler
Diffstat (limited to 'src/scheduler.cpp')
-rw-r--r--src/scheduler.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/scheduler.cpp b/src/scheduler.cpp
index 0c1cfa2718..923ba2c231 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);