Skip to content
Merged
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
8 changes: 1 addition & 7 deletions libraries/chain/include/eosio/chain/thread_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,7 @@ namespace eosio { namespace chain {
template<typename Rep, typename Period, typename F>
void run(const unsigned num_threads, const std::chrono::duration<Rep, Period>& ping_interval, F&& ping) {
std::vector<std::promise<void>> thread_promises(num_threads);
std::list<std::thread> threads;

//this scoped_exit can go away with jthread; but still marked experimental in libc++18
auto join = fc::make_scoped_exit([&threads]() {
for(std::thread& t : threads)
t.join();
});
std::list<std::jthread> threads;

for(unsigned i = 0; i < num_threads; ++i)
threads.emplace_back([this, i, &prom = thread_promises[i]] {
Expand Down