From 4b4bac7edd4181d929654f80b8bc74e48be21100 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Tue, 12 Oct 2021 16:49:10 +0200 Subject: [PATCH] Changed: Limit atomic_wait() to 1000ms to fix rare stall --- src/btop_tools.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {