usql update
This commit is contained in:
@@ -5,15 +5,15 @@
|
||||
#include <condition_variable>
|
||||
#include <vector>
|
||||
|
||||
class thread_pool {
|
||||
class ThreadPool {
|
||||
public:
|
||||
thread_pool(std::size_t size) : stop(false) {
|
||||
ThreadPool(std::size_t size) : stop(false) {
|
||||
for (std::size_t i = 0; i < size; ++i) {
|
||||
workers.emplace_back([this] { spawn(); });
|
||||
}
|
||||
}
|
||||
|
||||
virtual ~thread_pool() {
|
||||
virtual ~ThreadPool() {
|
||||
if (!stop) join();
|
||||
}
|
||||
|
||||
@@ -74,6 +74,6 @@ public:
|
||||
bool stop;
|
||||
};
|
||||
|
||||
inline void dispatch(thread_pool &pool, std::function<void()> f) {
|
||||
inline void dispatch(ThreadPool &pool, std::function<void()> f) {
|
||||
pool.post(f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user