Explicitly wake the main loop when scheduling a React revision merge (#57245)

Summary:
Pull Request resolved: https://github.com/react/react-native/pull/57245

Changelog: [IOS][FIXED] Add an explicit wake up call to the main loop hen scheduling a React revision merge

I could be possible that on idle screens the run loop is asleep, so without an explicit wake up call, the scheduled merges aren't processed.

This diff adds an explicit wake call when a merge is scheduled.

Reviewed By: rubennorte

Differential Revision: D108610347

fbshipit-source-id: 5ea02237b2152072b49a29482617fabbee34259f
This commit is contained in:
Jakub Piasecki authored and meta-codesync[bot] committed 2026-06-17 05:19:06 -07:00
1 parent 6fa330693f
commit 0cdb59f1b4
1 file changed
+10 -2
@@ -349,8 +349,16 @@ class ReactRevisionMergeRunLoopObserverDelegate final : public RunLoopObserver::
return;
}
std::lock_guard<std::mutex> lock(_pendingReactRevisionMergesMutex);
_pendingReactRevisionMerges.insert(surfaceId);
bool needsWake = false;
{
std::lock_guard<std::mutex> lock(_pendingReactRevisionMergesMutex);
needsWake = _pendingReactRevisionMerges.empty();
_pendingReactRevisionMerges.insert(surfaceId);
}
if (needsWake) {
CFRunLoopWakeUp(CFRunLoopGetMain());
}
}
- (void)_mergeReactRevisionForSurfaceId:(SurfaceId)surfaceId