Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/stan/callbacks/concurrent_writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <stan/math/prim/fun/Eigen.hpp>
#include <stan/math/prim/meta.hpp>
#include <tbb/concurrent_queue.h>
#include <atomic>
#include <condition_variable>
#include <functional>
#include <string>
Expand Down Expand Up @@ -59,7 +60,7 @@ struct concurrent_writer {
// Threshold where the writing threads will wait for the queues to empty
std::size_t wait_threshold{max_capacity - max_threads - 1};
// Flag to stop the writing thread once all queues are empty
bool continue_writing_{true};
std::atomic<bool> continue_writing_{true};

/**
* Constructs a concurrent writer from a writer.
Expand Down