MCPcopy Create free account
hub / github.com/Shangyizhou/A-Tiny-Network-Library / EventLoopThread

Method EventLoopThread

src/net/EventLoopThread.cc:4–13  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2#include "EventLoop.h"
3
4EventLoopThread::EventLoopThread(const ThreadInitCallback &cb,
5 const std::string &name)
6 : loop_(nullptr)
7 , exiting_(false)
8 , thread_(std::bind(&EventLoopThread::threadFunc, this), name) // 新线程绑定此函数
9 , mutex_()
10 , cond_()
11 , callback_(cb) // 传入的线程初始化回调函数,用户自定义的
12{
13}
14
15EventLoopThread::~EventLoopThread()
16{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected