Skip to content

Commit

Permalink
[LOCAL][RN] Clean up feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
cipolleschi committed Jan 8, 2025
1 parent fb7f87e commit cd7cf07
Showing 1 changed file with 17 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -501,27 +501,25 @@ void Binding::schedulerShouldRenderTransactions(
return;
}

if (ReactNativeFeatureFlags::
allowRecursiveCommitsWithSynchronousMountOnAndroid()) {
std::vector<MountingTransaction> pendingTransactions;

{
// Retain the lock to access the pending transactions but not to execute
// the mount operations because that method can call into this method
// again.
std::unique_lock<std::mutex> lock(pendingTransactionsMutex_);
pendingTransactions_.swap(pendingTransactions);
}

for (auto& transaction : pendingTransactions) {
mountingManager->executeMount(transaction);
}
} else {
std::vector<MountingTransaction> pendingTransactions;

{
// Retain the lock to access the pending transactions but not to execute
// the mount operations because that method can call into this method
// again.
//
// This can be re-entrant when mounting manager triggers state updates
// synchronously (this can happen when committing from the UI thread).
// This is safe because we're already combining all the transactions for the
// same surface ID in a single transaction in the pending transactions list,
// so operations won't run out of order.
std::unique_lock<std::mutex> lock(pendingTransactionsMutex_);
for (auto& transaction : pendingTransactions_) {
mountingManager->executeMount(transaction);
}
pendingTransactions_.clear();
pendingTransactions_.swap(pendingTransactions);
}

for (auto& transaction : pendingTransactions) {
mountingManager->executeMount(transaction);
}
}

Expand Down

0 comments on commit cd7cf07

Please sign in to comment.