diff options
| author | Stefan Boberg <[email protected]> | 2023-12-19 10:54:11 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-12-19 10:54:11 +0100 |
| commit | a8c4854f60d72d083bd34b34a9ccccc7353d052c (patch) | |
| tree | b67f14491390e81142f8293a20bc200be58c3fbb /src/zencore/zencore.cpp | |
| parent | fix ChunkIndexToChunkHash indexing (#621) (diff) | |
| download | zen-a8c4854f60d72d083bd34b34a9ccccc7353d052c.tar.xz zen-a8c4854f60d72d083bd34b34a9ccccc7353d052c.zip | |
various TSAN/ASAN/LeakAnalyzer fixes (#622)
* fix JobQueue test threading issue. The inner job queued with `QueueJob` would reference `I` from inside the captured closure which would subsequently disappear
* made sure application exit is thread safe
* don't try to access string data out of bounds
* keep-alive flag is accessed from multiple threads
* fix memory leaks in Zen upstream client code
* TSAN fixes for Event
Diffstat (limited to 'src/zencore/zencore.cpp')
| -rw-r--r-- | src/zencore/zencore.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/zencore/zencore.cpp b/src/zencore/zencore.cpp index eed903f54..d0acac608 100644 --- a/src/zencore/zencore.cpp +++ b/src/zencore/zencore.cpp @@ -37,6 +37,8 @@ #include <fmt/format.h> +#include <atomic> + namespace zen::assert { void @@ -104,8 +106,8 @@ IsInteractiveSession() ////////////////////////////////////////////////////////////////////////// -static int s_ApplicationExitCode = 0; -static bool s_ApplicationExitRequested; +static std::atomic_int s_ApplicationExitCode{0}; +static std::atomic_bool s_ApplicationExitRequested{false}; bool IsApplicationExitRequested() |