mirror of
https://github.com/laomms/wxhelper.git
synced 2024-12-23 02:09:23 +08:00
24 lines
439 B
C++
24 lines
439 B
C++
#ifndef BASE_THREAD_POOL_H_
|
|
#define BASE_THREAD_POOL_H_
|
|
#include "singleton.h"
|
|
#include <windows.h>
|
|
|
|
namespace base {
|
|
|
|
class ThreadPool :public Singleton<ThreadPool>{
|
|
public:
|
|
~ThreadPool();
|
|
|
|
bool Create(unsigned long min = 1, unsigned long max = 4);
|
|
|
|
bool AddWork(PTP_WORK_CALLBACK callback,PVOID opt);
|
|
|
|
private:
|
|
PTP_POOL pool_;
|
|
PTP_CLEANUP_GROUP cleanup_group_;
|
|
TP_CALLBACK_ENVIRON env_;
|
|
};
|
|
|
|
} // namespace wxhelper
|
|
|
|
#endif |