firebase / firebase/firebase-ios-sdk

FIRApp refactoring - thread safety

Open
#2,640 1 comment 0 reactions 1 assignee Claimed by @ncooke3 View on GitHub
api: core type: cleanup
Dominant language
C++
Stars
6.7k
Forks
1.8k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

We need to consider a cleaner way to support thread safety of `FIRApp`. It was brought up as a result of #2639 (see related issue, discussions and history)

Right now `@synchronized(self)` is used for this purpose. The main disadvantages of this approach is:
- it requires extra attention from a developer modifying the class. It is easy to miss when new logic is implemented. In fact, the original issue happened juts because some places where missed

In addition:
- it may lead to unintentional blocking of main thread by a background task
- it is possible to introduce a deadlock

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.