Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rename main thread to platform thread
  • Loading branch information
knopp committed Feb 27, 2024
commit a34e734a78118e7340ec33d418f40b148b6197e8
4 changes: 2 additions & 2 deletions shell/platform/darwin/macos/framework/Source/FlutterEngine.mm
Original file line number Diff line number Diff line change
Expand Up @@ -749,10 +749,10 @@ - (void)viewControllerViewDidLoad:(FlutterViewController*)viewController {
FlutterEngine* engine = weakSelf;
if (engine) {
// It is a bit unfortunate that embedder requires OnVSync call on
// main thread just to immediately redispatch it to UI thread.
// platform thread just to immediately redispatch it to UI thread.
// We are already on UI thread right now, but have to do the
// extra hop to main thread.
[engine->_threadSynchronizer performOnMainThread:^{
[engine->_threadSynchronizer performOnPlatformThread:^{
engine->_embedderAPI.OnVsync(_engine, baton, timeNanos, targetTimeNanos);
}];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* The block will be performed even if the platform thread is blocked waiting
* for a commit.
*/
- (void)performOnMainThread:(nonnull dispatch_block_t)block;
- (void)performOnPlatformThread:(nonnull dispatch_block_t)block;

/**
* Requests the synchronizer to track another view.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ - (void)performCommitForView:(int64_t)viewId
event.Wait();
}

- (void)performOnMainThread:(nonnull dispatch_block_t)block {
- (void)performOnPlatformThread:(nonnull dispatch_block_t)block {
std::unique_lock<std::mutex> lock(_mutex);
_scheduledBlocks.push_back(block);
if (_beginResizeWaiting) {
Expand Down