chenshuo / muduo

Event-driven network library for multi-threaded Linux server in C++11
https://github.com/chenshuo/muduo
Other
14.88k stars 5.18k forks source link

shared_from_this与this #647

Closed yijuwang closed 2 years ago

yijuwang commented 2 years ago

看TcpConnection.cpp里,用runinloop时绑定函数用的this,用queueinloop用的shared_from_this,可runinloop判断如果不是同一线程也会调queueinloop,想问下runinloop为什么不用shared_from_this,按理TcpConnection用的shared_ptr应该用shared_from_this啊