VOX
A little voxel engine
Loading...
Searching...
No Matches
JoinThreads.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4#include <thread>
5
6
8{
9public:
10 explicit JoinThreads(std::vector<std::thread> & threads)
11 : m_threads(threads) {}
12
13
15 {
16 for (size_t i = 0; i < m_threads.size(); i++)
17 {
18 if (m_threads[i].joinable())
19 {
20 m_threads[i].join();
21 }
22 }
23 }
24private:
25 std::vector<std::thread> & m_threads;
26};
Definition: JoinThreads.hpp:8
~JoinThreads()
Definition: JoinThreads.hpp:14
JoinThreads(std::vector< std::thread > &threads)
Definition: JoinThreads.hpp:10