-
Notifications
You must be signed in to change notification settings - Fork 948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TCPServer::Stop race condition bug #26
Comments
zieckey
added a commit
that referenced
this issue
Apr 9, 2017
zieckey
added a commit
that referenced
this issue
Apr 10, 2017
Fix by commit a421752 |
zieckey
added a commit
that referenced
this issue
Apr 27, 2017
zieckey
added a commit
that referenced
this issue
May 20, 2017
zieckey
added a commit
that referenced
this issue
May 20, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
上述83、86两行,都会调用到工作线程的
EventLoop::QueueInLoop
函数,也就是至少会调用两次。设想以下场景:EventLoop::DoPendingFunctors
函数中,EventLoop::QueueInLoop
函数中,刚把一个函数对象放到队列中,但还没有来得及调用watcher_.Notify()
EventLoop::StopInLoop
,刚刚好也执行完毕,会将EventLoop::watcher_
对象析构watcher_.Notify()
。由于上面第三个时间点EventLoop::watcher_
对象已经析构,最终导致程序崩溃。这个场景可以用“testTCPServer1”来重现,可能需要运行很多次才能重现。
HTTPServer有类似问题,需要一起修复。
The text was updated successfully, but these errors were encountered: