gecko-dev/mobile
Petru Lingurar 6e6e460616 Bug 1556083 - Resolve deadlock by using just one lock, not two; r=VladBaicu
Classic deadlock situation possible because getDatabaseHelperForProfile(..)
would lock on [PerProfileDatabase] and then try to on [GeckoProfile] while at
the same time it would be possible for another thread which already had the
[GeckoProfile] lock to call this method and so try to acquire the
[PerProfileDatabase] lock.

The simplest solution to resolve this and the one I went with is to ensure that
one of those threads will not need both locks and it turns out that the
getDatabaseHelperForProfile method can easily be refactored to use only the
GeckoProfile lock, change which would not significantly increase the block of
code synchronized with the same key.

Differential Revision: https://phabricator.services.mozilla.com/D35646

--HG--
extra : moz-landing-system : lando
2019-06-24 17:52:40 +00:00
..
android Bug 1556083 - Resolve deadlock by using just one lock, not two; r=VladBaicu 2019-06-24 17:52:40 +00:00
locales Bug 1523741 - Converting legacy aboutTelemetry to Fluent aboutTelemetry, r=jaws,flod,Gijs 2019-04-08 09:15:16 +00:00