mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
Make a bool atomic in env_universal_common.cpp
Fixes a race identified by thread sanitizer
This commit is contained in:
parent
cb70ac6932
commit
2565ffab25
1 changed files with 1 additions and 1 deletions
|
@ -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
|
// We pass O_RDONLY with O_CREAT; this creates a potentially empty file. We do this so that we
|
||||||
// have something to lock on.
|
// have something to lock on.
|
||||||
static bool do_locking = true;
|
static std::atomic<bool> do_locking(true);
|
||||||
bool needs_lock = true;
|
bool needs_lock = true;
|
||||||
int flags = O_RDWR | O_CREAT;
|
int flags = O_RDWR | O_CREAT;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue