From be3cf7e961fe36cca26a96c1df1bc7ba73526b3f Mon Sep 17 00:00:00 2001 From: Steve Bronder Date: Fri, 10 Jan 2025 16:30:25 -0500 Subject: [PATCH] add includes for concurrent writer --- src/stan/callbacks/concurrent_writer.hpp | 17 +++++++++++------ src/stan/services/pathfinder/multi.hpp | 1 - 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/stan/callbacks/concurrent_writer.hpp b/src/stan/callbacks/concurrent_writer.hpp index 147cc9861d..f23a21048b 100644 --- a/src/stan/callbacks/concurrent_writer.hpp +++ b/src/stan/callbacks/concurrent_writer.hpp @@ -1,6 +1,14 @@ #ifndef STAN_CALLBACKS_CONCURRENT_WRITER_HPP #define STAN_CALLBACKS_CONCURRENT_WRITER_HPP +#include +#include +#include +#include +#include +#include +#include + #ifdef STAN_THREADS /** * Takes a writer and makes it thread safe via multiple queues. @@ -33,19 +41,16 @@ struct concurrent_writer { std::string str; std::vector vec_str; Eigen::RowVectorXd eigen; - std::size_t max_size = 0; while (continue_writing_ || !(str_messages_.empty() && vec_str_messages_.empty() && eigen_messages_.empty())) { - if (str_messages_.try_pop(str)) { + while (str_messages_.try_pop(str)) { writer(str); } - if (vec_str_messages_.try_pop(vec_str)) { + while (vec_str_messages_.try_pop(vec_str)) { writer(vec_str); } - max_size = std::max(max_size, - static_cast(eigen_messages_.size())); - if (eigen_messages_.try_pop(eigen)) { + while (eigen_messages_.try_pop(eigen)) { writer(eigen); } } diff --git a/src/stan/services/pathfinder/multi.hpp b/src/stan/services/pathfinder/multi.hpp index 480e63e617..0f2f43a4c6 100644 --- a/src/stan/services/pathfinder/multi.hpp +++ b/src/stan/services/pathfinder/multi.hpp @@ -17,7 +17,6 @@ #include #include #include -#include #include #include #include