muduo的channel的gurad的生命周期问题

在muduo的书中第八章的动手写一个类似的muduo库, ---- Channel 类中是没有定义Channel::tie() 也就没有tie_ , 不知道作者是不是为了异常安全的, 不懂 - - @陈硕


void Channel::handleEvent(Timestamp receiveTime)
{
boost::shared_ptr\u0026lt;void\u0026gt; guard;
【muduo的channel的gurad的生命周期问题】 if (tied_)
{
guard = tie_.lock();
if (guard)
{
handleEventWithGuard(receiveTime);
}
}
else
{
handleEventWithGuard(receiveTime);
}
}






    推荐阅读