fortuna: std::unique_lock x2 -> std::scoped_lock
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4c77810535
commit
760fd1bd9c
|
@ -54,16 +54,14 @@ public:
|
|||
// p. 153
|
||||
set_reseed_ctr_to_null();
|
||||
std::unique_lock<std::mutex> p_ul(print_mtx);
|
||||
std::unique_lock<std::mutex> a_ul(mtx_accu, std::defer_lock);
|
||||
std::unique_lock<std::mutex> pp_ul(mtx_p_pools, std::defer_lock);
|
||||
|
||||
std::scoped_lock sl(mtx_accu, mtx_p_pools);
|
||||
try {
|
||||
std::lock(a_ul, pp_ul);
|
||||
R.initialize_pools();
|
||||
fmt::print("[i] fortuna: pools initialized\n");
|
||||
p_ul.unlock();
|
||||
accumulator.set_pools_ptr(R._p_pools);
|
||||
accumulator.set_gen(R.Gen);
|
||||
a_ul.unlock();
|
||||
|
||||
// FIXME: bogus first reseed here, P_0 definitely hasn't collected
|
||||
// enough entropy by now
|
||||
|
|
Reference in New Issue