mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 15:18: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 "zeek/zeek-config.h"
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include <atomic>
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
|
@ -201,8 +202,8 @@ private:
|
||||||
const char* name;
|
const char* name;
|
||||||
std::thread thread;
|
std::thread thread;
|
||||||
bool started; // Set to to true once running.
|
bool started; // Set to to true once running.
|
||||||
bool terminating; // Set to to true to signal termination.
|
std::atomic_bool terminating; // Set to to true to signal termination.
|
||||||
bool killed; // Set to true once forcefully killed.
|
std::atomic_bool killed; // Set to true once forcefully killed.
|
||||||
|
|
||||||
// For implementing Fmt().
|
// For implementing Fmt().
|
||||||
uint32_t buf_len;
|
uint32_t buf_len;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue