-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[camera] Avoid joining thread causing ANR #6224
Conversation
@@ -677,11 +677,6 @@ public void stopBackgroundThread() { | |||
if (backgroundHandlerThread != null) { | |||
stoppingBackgroundHandlerThread = true; | |||
backgroundHandlerThread.quitSafely(); | |||
try { | |||
backgroundHandlerThread.join(); |
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.
What does stoppingBackgroundHandlerThread
do without this join? Presumably from the description quitSafely
is asynchronous, so it looks like we're now setting it to true and then back to false within the same execution cycle.
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.
Oh you're right. I think I added that not knowing it was acting as a bandaid for the real problem!
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 with versioning nit.
@@ -1,3 +1,7 @@ | |||
## 0.10.1 |
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.
Nit: this should be 0.10.1+2 since it's a bugfix to a <1.0 package.
Is it release yet? |
Yes, changes to our packages are generally published immediately. |
Addresses flutter/flutter#106493. Stops calling
join
on the backgroundHandlerThread
since it is not needed for any thread synchronization andquitSafely
is used to ensure any outstanding messages are delivered.Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.