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

Method Thread

src/base/Thread.cc:12–22  ·  view source on GitHub ↗

* TODO:error * default argument given for parameter 2 of ‘Thread::Thread(Thread::ThreadFunc, const string&)’GCC * 默认参数在定义和声明中只能出现一次,不能声明和定义都有默认参数 */

Source from the content-addressed store, hash-verified

10 * 默认参数在定义和声明中只能出现一次,不能声明和定义都有默认参数
11 */
12Thread::Thread(ThreadFunc func, const std::string &name) :
13 started_(false), // 还未开始
14 joined_(false), // 还未设置等待线程
15 tid_(0), // 初始 tid 设置为0
16 func_(std::move(func)), // EventLoopThread::threadFunc()
17 name_(name) // 默认姓名是空字符串
18
19{
20 // 设置线程索引编号和姓名
21 setDefaultName();
22}
23
24Thread::~Thread()
25{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected