Skip to content

Commit

Permalink
make sure not producer threads are waiting before joining
Browse files Browse the repository at this point in the history
  • Loading branch information
SteveBronder committed Feb 12, 2025
1 parent 456f290 commit 7bd2826
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/stan/callbacks/concurrent_writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ struct concurrent_writer {
void wait() {
continue_writing_ = false;
if (thread_.joinable()) {
// If any threads are waiting for the queues to empty, notify them
cv.notify_all();
thread_.join();
}
}
Expand Down

0 comments on commit 7bd2826

Please sign in to comment.