2013-05-01 12:08:01 +00:00
|
|
|
#pragma once
|
|
|
|
|
2013-05-02 05:46:30 +00:00
|
|
|
#include "thread/threadpool.h"
|
2013-05-01 12:08:01 +00:00
|
|
|
|
|
|
|
class GlobalThreadPool {
|
|
|
|
public:
|
|
|
|
// will execute slices of "loop" from "lower" to "upper"
|
|
|
|
// in parallel on the global thread pool
|
2013-05-02 05:46:30 +00:00
|
|
|
static void Loop(const function<void(int,int)>& loop, int lower, int upper);
|
2013-05-01 12:08:01 +00:00
|
|
|
|
|
|
|
private:
|
2013-05-02 05:46:30 +00:00
|
|
|
static shared_ptr<ThreadPool> pool;
|
2013-05-01 12:08:01 +00:00
|
|
|
static bool initialized;
|
|
|
|
static void Inititialize();
|
|
|
|
};
|