Files
firebase-ios-sdk/Firebase/Core
Gil 308e36a276 Fix race condition in FIRComponentContainer instance creation (#3984)
* Fix race condition in FIRComponentContainer instance creation

Reported in #3967. Users sometimes seeing a crash when multiple threads
concurrently try to create Firestore instances. By inspection I found
that there's a race here where two threads can check for presence in the
cache, see nothing, proceed to creation, both store a value in the cache,
and both return their copies. This would lead to two Firestores being
created for a single App.

This replaces `dispatch_sync` on a serial queue with good old
`@synchronized` blocks. `dispatch_sync` will self-deadlock if called
from a thread already on the queue while `@synchronized` allows
recursion.

No new tests are added because several tests like
`testDependencyDoesntBlock` already cover this case.

* format
2019-10-03 11:35:33 -04:00
..
2019-09-23 10:41:33 -07:00
2019-09-14 07:22:44 -07:00