a8/a8/ioloop.h
aozhiwei c6af863cf2 1
2019-06-03 16:00:37 +08:00

33 lines
553 B
C++

#ifndef A8_IOLOOP_H
#define A8_IOLOOP_H
#include <a8/a8.h>
#include <a8/types.h>
namespace a8
{
class IoLoop : public a8::Singleton<IoLoop>
{
private:
IoLoop() {};
friend class a8::Singleton<IoLoop>;
public:
void Init();
void UnInit();
volatile int epoll_fd = a8::INVALID_FD;
private:
void WorkerThreadProc();
private:
int max_client_num_ = 1000;
volatile bool worker_thread_shutdown_ = false;
std::thread* worker_thread_ = nullptr;
};
}
#endif