Fix bug on the disorder of calling shutdown callback#2097
Conversation
Signed-off-by: Barry Xu <barry.xu@sony.com>
clalancette
left a comment
There was a problem hiding this comment.
One very minor thing pointed out inline. Otherwise looks good with green CI.
fujitatomoya
left a comment
There was a problem hiding this comment.
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