-
Notifications
You must be signed in to change notification settings - Fork 412
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
Fix bug on the disorder of calling shutdown callback #2097
Fix bug on the disorder of calling shutdown callback #2097
Conversation
Signed-off-by: Barry Xu <barry.xu@sony.com>
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.
One very minor thing pointed out inline. Otherwise looks good with green CI.
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.
lgtm! @Barry-Xu-2018 thanks for quick response.
@clalancette @alsora thanks for the review, btw can we backport this to humble? |
Hm. So unfortunately, this breaks ABI because of the change of type from |
Signed-off-by: Barry Xu <barry.xu@sony.com>
@clalancette if the backport is hard requirement, we would probably consider other approach. I believe that breaking ABI/API policy would be much bigger problem. |
In order to keep ABI compatible, we cannot add new variable (except static variable) into class Context. struct ShutdownCallback {
std::vector<weak_ptr> pre_callback;
std::vector<weak_ptr> on_callback;
};
static std:map<Context*, ShutdownCallback> g_shutdownCallback;
static mutex s_shutdownCallback_mutex; Change code on adding/removing/call shutdown callback to use this global variable. Now I not find better approach |
I'm going to go ahead and merge this one in, since it is an obvious improvement for Rolling. We can consider fixing Humble (either the documentation or with an ABI-compatible fix) separately. |
* Fix bug on the disorder of calling shutdown callback Signed-off-by: Barry Xu <barry.xu@sony.com>
* Fix bug on the disorder of calling shutdown callback Signed-off-by: Barry Xu <barry.xu@sony.com>
* Fix bug on the disorder of calling shutdown callback Signed-off-by: Barry Xu <barry.xu@sony.com>
* Fix bug on the disorder of calling shutdown callback Signed-off-by: Barry Xu <barry.xu@sony.com>
Address #2096
Signed-off-by: Barry Xu barry.xu@sony.com