mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
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:
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
|
||||
|
||||
Reference in new issue
Block a user