mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-26 12:44:38 +00:00
First, the only lock we can use for the time being is the database lock, because if we use some other lock we could deadlock. That said, it seems like we could avoid using a lock at all. The purpose of the lock was to eliminate double-lookups, but if we have to acquire the database lock to check if we need to do the lookup, we've lost the advantage of doing so at all. We *could* just do a traditional check-lock-check pattern to get the lock far less often, but given that we're likely going to acquire it during startup, even a single access has the possibility of really gumming up the works.