mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-20 20:49:50 +01:00
Add perf counter data to GetStrongRandBytes state in scheduler
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user