diff options
author | Tianjie Xu <xunchang@google.com> | 2019-05-21 15:21:15 -0700 |
---|---|---|
committer | Tianjie Xu <xunchang@google.com> | 2019-05-22 16:44:35 -0700 |
commit | 347e62aed01ccc8e5d2cd901eb150e29653a6d96 (patch) | |
tree | 238b8d5a27ea2db1eab3138367cf8c09c0dbfbc6 /update_boot_flags_action.h | |
parent | f6fd73661bebb7fec2a672da29379a7fe4e6c0eb (diff) |
Skip an async callback function when the UpdateBootFlagsAction object is destroyed
As the callback to MarkBootSuccessfulAsync, UpdateBootFlagsAction's
member function CompleteUpdateBootFlags() can still be called even after
the current UpdateBootFlagsAction object get destroyed by the action
processor. We want to set a static flag in TerminateProcessing() and check
its value before executing the callback function.
An alternative way is to save and propagate the TaskId when scheduling the
task in MarkBootSuccessfulAsync, and cancel the task in UpdateBootFlagsAction's
TerminateProcessing().
Bug: 123720545
Test: No longer hit the CHECK after injecting StopProcessing.
Change-Id: I98d2cc7b94d4059fb897b89932969b61936e8c2e
(cherry picked from commit e1f55b0f39a109760ce6983d0b8f6f498ec90f52)
Diffstat (limited to 'update_boot_flags_action.h')
-rw-r--r-- | update_boot_flags_action.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/update_boot_flags_action.h b/update_boot_flags_action.h index afa2c3f1..892aab7b 100644 --- a/update_boot_flags_action.h +++ b/update_boot_flags_action.h @@ -30,6 +30,8 @@ class UpdateBootFlagsAction : public AbstractAction { void PerformAction() override; + void TerminateProcessing() override; + static std::string StaticType() { return "UpdateBootFlagsAction"; } std::string Type() const override { return StaticType(); } |