Skip to content

Commit

Permalink
detach threads later
Browse files Browse the repository at this point in the history
  • Loading branch information
dfalbel committed Nov 13, 2024
1 parent 12ad6b0 commit df84458
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion inst/include/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,10 @@ class ThreadPool {
~ThreadPool() {
event_loop.stop();
for(auto& thread : threads) {
thread.join();
// Ideally we would join those threads, but this deadlocks on Windows.
// Detaching seems fine as after `stop` we're making sure that all tasks
// are done.
thread.detach();
}
}
};
Expand Down

0 comments on commit df84458

Please sign in to comment.