2013-05-01 14:08:01 +02:00
|
|
|
#pragma once
|
|
|
|
|
2020-10-01 09:27:25 +02:00
|
|
|
#include "Common/Thread/ThreadPool.h"
|
2013-05-01 14:08:01 +02:00
|
|
|
|
|
|
|
class GlobalThreadPool {
|
|
|
|
public:
|
|
|
|
// will execute slices of "loop" from "lower" to "upper"
|
|
|
|
// in parallel on the global thread pool
|
2013-06-02 22:26:51 +10:00
|
|
|
static void Loop(const std::function<void(int,int)>& loop, int lower, int upper);
|
2013-05-01 14:08:01 +02:00
|
|
|
|
|
|
|
private:
|
2019-08-10 20:55:52 +02:00
|
|
|
static std::unique_ptr<ThreadPool> pool;
|
|
|
|
static std::once_flag init_flag;
|
2013-05-01 14:08:01 +02:00
|
|
|
static void Inititialize();
|
|
|
|
};
|