diff options
| author | 2023-04-21 15:01:03 -0400 | |
|---|---|---|
| committer | 2023-04-27 09:37:04 -0400 | |
| commit | 6c440aeb79fdadca718d34f6eca754589730afb0 (patch) | |
| tree | ab63fc02deada9a2ac1769376ae15847bb089f39 /libs/ultrahdr/jpegencoderhelper.cpp | |
| parent | 8bf29931eabb065027fda7ffa7db294b04772a36 (diff) | |
Make VSyncCallbackRegistration's move operator= call unregisterCallback
Skipping unregisterCallback means that we might delete a callback while
it is being called. Note that EventThread uses the move operator=, and
this behaves differently than if it were stored in a unique_ptr like in
MessageQueue. Update move operator= so that they do behave the same, and
add tests verifying this, along with a couple other behavior tests.
Note that this may result in deadlocks similar to those in b/276367387.
That is fixed by If490f88115aa298d31aa9ad392a1f9f9dc987549.
Cleanups:
- Remove comment for VsyncCallbackRegistration regarding the lifetime
requirement for the VSyncDispatch.
Icdb80253436b4d0034fc20fcae8583efb7c30292 switched the VSyncDispatch
to an std::shared_ptr from a reference, so the client no longer needs
to ensure that the VSyncDispatch outlives the VsyncCallbackRegistration.
- Replace mValidToken with using an std::optional for the token.
Bug: 279209321
Test: VSyncCallbackRegistrationTest
Change-Id: I3c1eccb36914f29560600d48bb08b1b8f2fe7c96
Diffstat (limited to 'libs/ultrahdr/jpegencoderhelper.cpp')
0 files changed, 0 insertions, 0 deletions