Update git submodules
* Update frameworks/support from branch 'androidx-main'
to 7b8aed1752d8a4571706340993e1c71cbb984a09
- Merge "Synchronize adding and removing table trackers." into androidx-main
- Synchronize adding and removing table trackers.
Replace the usage of a 'pending sync' flag, onSyncCompleted() callback and a while(true) loop with a sync block to protect adding and removing table triggers from race conditions. Specifically the strategy of the flag along with the loop made sure only one thread would proceed to update triggers and would release other threads from the responsibility. However, in certain conditions, a trigger sync might be already occurring and a new write transaction is started, but does not wait for the triggers sync to finish, possibly causing invalidation of newly added observers to be missed.
Using a sync block is simple but it does introduce contingency, as now every add / remove observers call along with beginTransaction() might need to wait if there is another thread within the block.
Bug: 215583326
Test: SyncTriggersConcurrencyTest
Change-Id: I3f18daf2a61eca2c872668c818f75b3b03204988
Loading
Please sign in to comment