int32 EventLoop::startLoop() { startCtl(); if (!m_run) { m_run = true; int32 ret = ef::thread_create(&m_thread, NULL, (PTHREAD_FUNC)workThreadProcess, this); return ret; } }
int32 EventLoop::init() { int32 ret = 0; m_epl = epoll_create(m_max_fds); if(m_epl < 0) { NLogError << "EventLoop:" << std::hex << this << " init epoll_create fail!"; return -1; } ret = startCtl(); if(ret < 0) { NLogError << "EventLoop:" << std::hex << this << " init startCtl fail!"; return -4; } if(m_init) { m_init(this, m_obj); } return 0; }