mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-26 12:53:13 +00:00
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.
This commit is contained in:
parent
3c537bfa65
commit
b5b9406711
1 changed files with 1 additions and 1 deletions
|
@ -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<bool> locked { false };
|
||||
if (locked) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue