forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1756251 - fix concurrency bug in GeckoJavaSampler.isProfilerActiv…
…e. r=geckoview-reviewers,julienw,agi Concurrency bug: this method accesses mutable state but is not synchronized so the caller isn't guaranteed to see the latest values. We fix it by using an AtomicReference. This slightly complicates the thread policy (which is to otherwise synchronize access to mutable state) but avoids the increased contention that could come from using synchronized for consistency. This is the only concurrency bug I found throughout my thread safety documentation. Differential Revision: https://phabricator.services.mozilla.com/D139199
- Loading branch information
Showing
1 changed file
with
22 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters