mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
Mark bools in BasicThread as atomic to avoid data races
This commit is contained in:
parent
f50777cdab
commit
268ebbaffd
1 changed files with 3 additions and 2 deletions
|
@ -4,6 +4,7 @@
|
|||
#include "zeek/zeek-config.h"
|
||||
|
||||
#include <stdint.h>
|
||||
#include <atomic>
|
||||
#include <iosfwd>
|
||||
#include <thread>
|
||||
|
||||
|
@ -201,8 +202,8 @@ private:
|
|||
const char* name;
|
||||
std::thread thread;
|
||||
bool started; // Set to to true once running.
|
||||
bool terminating; // Set to to true to signal termination.
|
||||
bool killed; // Set to true once forcefully killed.
|
||||
std::atomic_bool terminating; // Set to to true to signal termination.
|
||||
std::atomic_bool killed; // Set to true once forcefully killed.
|
||||
|
||||
// For implementing Fmt().
|
||||
uint32_t buf_len;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue