mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-23 04:51:16 -03:00
Make a bool atomic in env_universal_common.cpp
Fixes a race identified by thread sanitizer
This commit is contained in:
@@ -577,7 +577,7 @@ bool env_universal_t::open_and_acquire_lock(const wcstring &path, int *out_fd) {
|
||||
//
|
||||
// We pass O_RDONLY with O_CREAT; this creates a potentially empty file. We do this so that we
|
||||
// have something to lock on.
|
||||
static bool do_locking = true;
|
||||
static std::atomic<bool> do_locking(true);
|
||||
bool needs_lock = true;
|
||||
int flags = O_RDWR | O_CREAT;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user