Add perf counter data to GetStrongRandBytes state in scheduler

This commit is contained in:
Matt Corallo
2017-05-22 16:01:52 -04:00
parent 399fb8f2d0
commit 888cce57a6
3 changed files with 30 additions and 0 deletions

View File

@@ -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);