代码拉取完成,页面将自动刷新
/*
eventloop匹配的线程
*/
#pragma once
#include "eventloop.h"
#include "util.h"
#include "Thread.h"
#include <mutex>
#include <condition_variable>
class EventLoopThread:noncopyable{
private:
//线程入口函数
void threadFunc();
EventLoop* m_loop;
Thread m_thread;
std::mutex m_mtx;
std::condition_variable m_cv;
public:
EventLoopThread();
~EventLoopThread();
//开始loop
//为什么不直接在线程启动时就返回eventloop呢?我觉得是因为线程启动有时延,如果返回了一个nullptr, 会使程序奔溃
EventLoop *startLoop();
};
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。