mirror of
https://github.com/triqs/dft_tools
synced 2024-12-25 05:43:40 +01:00
Fix detail in callbacks
This commit is contained in:
parent
bf3833f803
commit
422cabd52e
@ -28,10 +28,10 @@ namespace utility {
|
||||
std::function<bool()> clock_callback(int time_in_seconds) {
|
||||
signal_handler::start();
|
||||
if (time_in_seconds <= 0)
|
||||
return []() { return (!triqs::signal_handler::received()); };
|
||||
return []() { return (triqs::signal_handler::received()); };
|
||||
|
||||
auto end_time = std::chrono::system_clock::now() + std::chrono::seconds(time_in_seconds);
|
||||
return [end_time]() { return (!triqs::signal_handler::received()) || (std::chrono::system_clock::now() > end_time); };
|
||||
return [end_time]() { return (triqs::signal_handler::received()) || (std::chrono::system_clock::now() > end_time); };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user