fortuna: use die_point latch
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
wait on the latch in Fortuna's dtor until threads finish execution
This commit is contained in:
parent
680272bed4
commit
fa4c9d048e
|
@ -39,6 +39,7 @@ Fortuna::Fortuna() {
|
|||
}
|
||||
}
|
||||
Fortuna::~Fortuna() noexcept {
|
||||
this->die_point.wait();
|
||||
fmt::print("[*] Fortuna says goodbye!\n");
|
||||
}
|
||||
|
||||
|
@ -159,6 +160,10 @@ auto Fortuna::seed_file_manager_service() -> void {
|
|||
std::this_thread::sleep_until(right_now +
|
||||
std::chrono::seconds(checkup_interval));
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> p_ul(print_mtx);
|
||||
fmt::print("[*] sfm: stopping, goodbye!\n\n");
|
||||
this->die_point.count_down();
|
||||
}
|
||||
|
||||
auto Fortuna::urandom_entropy_src_service() -> void {
|
||||
|
@ -210,6 +215,10 @@ auto Fortuna::urandom_entropy_src_service() -> void {
|
|||
}
|
||||
mtx_l.unlock();
|
||||
}
|
||||
|
||||
std::lock_guard<std::mutex> p_ul(print_mtx);
|
||||
fmt::print("[*] ues: stopping, goodbye!\n\n");
|
||||
this->die_point.count_down();
|
||||
}
|
||||
|
||||
} // namespace fortuna
|
||||
|
|
Reference in New Issue