chenshuo / muduo

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

shared_from_this与this #647

Closed yijuwang closed 1 year ago

yijuwang commented 1 year ago

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