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

connection是否应该进行线程保护? #684

Closed sirius-zyj closed 1 year ago

sirius-zyj commented 1 year ago

image 此处一增一减,是否应该进行线程保护,比如加锁?

chenshuo commented 1 year ago

不用。 因为这两个函数开头都有:

loop_->assertInLoopThread();