From b5b9406711fde15162a0bc3f52b4d656c2e18aa4 Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Sun, 31 Mar 2019 18:09:59 -0500 Subject: [PATCH] Use explicit atomic/CAS to prevent race conditions They are probably equivalent on x86/64 being single-byte reads/writes, but it never hurts to be safe. --- src/proc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/proc.cpp b/src/proc.cpp index 24b266920..4d224b8f9 100644 --- a/src/proc.cpp +++ b/src/proc.cpp @@ -463,7 +463,7 @@ static bool process_clean_after_marking(bool allow_interactive) { // This function may fire an event handler, we do not want to call ourselves recursively (to // avoid infinite recursion). - static bool locked = false; + static std::atomic locked { false }; if (locked) { return false; }