diff --git a/src/btop_tools.hpp b/src/btop_tools.hpp index 97e010a..27463a5 100644 --- a/src/btop_tools.hpp +++ b/src/btop_tools.hpp @@ -269,7 +269,7 @@ namespace Tools { string hostname(); string username(); - inline void atomic_wait(const atomic& atom, const bool old=true) noexcept { while (atom.load() == old) sleep_ms(1); } + inline void atomic_wait(const atomic& atom, const bool old=true) noexcept { for (int x = 0; atom.load() == old and x < 1000; x++) sleep_ms(1); } //* Waits for atomic to be false and sets it to true on construct, sets to false on destruct class atomic_lock {