Changed: Limit atomic_wait() to 1000ms to fix rare stall

This commit is contained in:
aristocratos 2021-10-12 16:49:10 +02:00
parent 27c58dfc76
commit 4b4bac7edd
1 changed files with 1 additions and 1 deletions

View File

@ -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 {