33 lines
647 B
C++
33 lines
647 B
C++
#ifndef DISTRIBUTION_SERVICE_MAIN_THREAD_H
|
|
#define DISTRIBUTION_SERVICE_MAIN_THREAD_H
|
|
|
|
#include "CCThreadPool.h"
|
|
#include "../Configuration/Config.h"
|
|
|
|
class ThreadMain {
|
|
CTL::ThreadPool m_threadPool;
|
|
public:
|
|
int MaxPool = 1024;
|
|
int CorePool = 60;
|
|
int KeepAliveTime = 1000 * 10;
|
|
private:
|
|
ThreadMain() {
|
|
m_threadPool.InitStart(CorePool, MaxPool, KeepAliveTime);
|
|
}
|
|
~ThreadMain() {
|
|
|
|
}
|
|
void run() {
|
|
|
|
}
|
|
public:
|
|
static ThreadMain* getInstance() {
|
|
static ThreadMain instance;
|
|
return &instance;
|
|
}
|
|
void init() {
|
|
m_threadPool.AddTask(&ThreadMain::run,this);
|
|
}
|
|
};
|
|
|
|
#endif |