Replies: 1 comment
-
|
直接在使用构造函数中对quit_的赋值,在call loop 不需要对quit_赋值;还在call loop 赋值quit_的目的是什么 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
这个问题应该作者发现了,标注了FIXME。
一种容易出现的场景是muduo/net/tests/EventLoopThreadPool_unittest.cc 之中,EventLoopThread对象刚创建时 创建了一个线程 在那个线程里面call loop ,但是那个线程还没走到loop,结果本线程的EventLoopThread对象发生了析构,导致quit先调用,loop后调用,本应退出的EventLoop::quit_标志位在EventLoop::loop之中被清除,程序无法退出。
Ubuntu 18.04 , cpp11 , gcc 7.4.0
Beta Was this translation helpful? Give feedback.
All reactions