fortuna: run svcs while(continue_running.load())
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
surtur 2022-01-23 20:47:42 +01:00
parent 5693b24ee0
commit a68166da57
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -45,6 +45,10 @@ Fortuna::~Fortuna() noexcept {
auto Fortuna::random_data(unsigned int n_bytes) -> void {
if (!this->continue_running.load()) {
return;
}
std::lock_guard<std::mutex> lg(mtx_random_data);
const auto start{std::chrono::system_clock::now()};
@ -132,7 +136,7 @@ auto Fortuna::seed_file_manager_service() -> void {
a_ul.unlock();
mtx_l.unlock();
while (true) {
while (this->continue_running.load()) {
right_now = fortuna::Util::current_time();
{
std::lock_guard<std::mutex> p_ul(print_mtx);
@ -189,7 +193,7 @@ auto Fortuna::urandom_entropy_src_service() -> void {
accumulator::EventAdderImpl adder(src_id, this->R._p_pools);
mtx_l.unlock();
while (true) {
while (this->continue_running.load()) {
try {
std::lock_guard<std::mutex> p_ul(print_mtx);
fmt::print("[i] now: {}\n", fortuna::Util::current_time());