Use atomics and size_t

Using atomics here is essential because this variable may be modified in
parallel by different threads.
This commit is contained in:
Noah Lev 2024-07-07 11:39:23 -07:00
parent 9272e84b87
commit 2e2daea263

View File

@ -227,7 +227,7 @@ private:
spinlock _latency_points_lock; //< Spinlock that protects the latency points map
static_map<pid_t, thread_state> _thread_states; //< Map from thread IDs to thread-local state
uint64_t _num_threads_running; //< Number of threads that are currently being sampled
std::atomic<size_t> _num_threads_running; //< Number of threads that are currently being sampled
std::atomic<bool> _experiment_active; //< Is an experiment running?
std::atomic<size_t> _global_delay; //< The global delay time required