-
Notifications
You must be signed in to change notification settings - Fork 68
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
[4.0] Fix possible segfault switching between read/write windows #1719
Conversation
…SEGFAULT and deadlock.
…only mode and spawn threads that access the queue.
bool execute_highest() | ||
{ | ||
if( !handlers_.empty() ) { | ||
auto t = pop(); | ||
bool empty = handlers_.empty(); | ||
t->execute(); | ||
return !empty; | ||
} | ||
|
||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to change, but just to chat I would have written it like that.
bool execute_highest() | |
{ | |
if( !handlers_.empty() ) { | |
auto t = pop(); | |
bool empty = handlers_.empty(); | |
t->execute(); | |
return !empty; | |
} | |
return false; | |
} | |
bool execute_highest() | |
{ | |
bool empty = handlers_.empty(); | |
if( !empty ) { | |
auto t = pop(); | |
empty = handlers_.empty(); | |
t->execute(); | |
} | |
return !empty; | |
} |
|
||
boost::system::error_code ec; | ||
my->_timer.cancel(ec); | ||
boost::system::error_code ro_ec; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there doesn't appear to be a need for the second ro_ec
here
my->_timer.cancel(ec); | ||
boost::system::error_code ro_ec; | ||
my->_ro_timer.cancel(ro_ec); | ||
app().executor().stop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this line some more? In what cases would we make it here and the appbase executor would still be running?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The appbase executor is not running here. However, the read-only threads can still be running and some can be paused on the condition variable in exec_pri_queue
, trying to then join their threads cause them to deadlock.
Backport of #1718
Resolves #1490