mirror of https://github.com/aristocratos/btop.git
Changed: Limit atomic_wait() to 1000ms to fix rare stall
This commit is contained in:
parent
27c58dfc76
commit
4b4bac7edd
|
@ -269,7 +269,7 @@ namespace Tools {
|
|||
string hostname();
|
||||
string username();
|
||||
|
||||
inline void atomic_wait(const atomic<bool>& atom, const bool old=true) noexcept { while (atom.load() == old) sleep_ms(1); }
|
||||
inline void atomic_wait(const atomic<bool>& atom, const bool old=true) noexcept { for (int x = 0; atom.load() == old and x < 1000; x++) sleep_ms(1); }
|
||||
|
||||
//* Waits for atomic<bool> to be false and sets it to true on construct, sets to false on destruct
|
||||
class atomic_lock {
|
||||
|
|
Loading…
Reference in New Issue