Skip to content

Commit

Permalink
EmulationCoordinator: Undeclare the UI thread as the host thread whil…
Browse files Browse the repository at this point in the history
…e emulation is running
  • Loading branch information
OatmealDome committed Jan 19, 2024
1 parent 3d4542b commit 93d6e1b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/iOS/App/Common/Emulation/EmulationCoordinator.mm
Expand Up @@ -88,6 +88,10 @@ - (void)runEmulationWithBootParameter:(EmulationBootParameter*)bootParameter {
}

- (void)emulationLoopWithBootParameter:(EmulationBootParameter*)bootParameter {
dispatch_sync(dispatch_get_main_queue(), ^{
Core::UndeclareAsHostThread();
});

DOLHostQueueRunSync(^{
__block WindowSystemInfo wsi;
wsi.type = WindowSystemType::iOS;
Expand All @@ -111,6 +115,10 @@ - (void)emulationLoopWithBootParameter:(EmulationBootParameter*)bootParameter {
[NSThread sleepForTimeInterval:0.025];
}

dispatch_sync(dispatch_get_main_queue(), ^{
Core::DeclareAsHostThread();
});

[[NSNotificationCenter defaultCenter] postNotificationName:DOLEmulationDidEndNotification object:self userInfo:nil];

_mainDisplayView = nil;
Expand Down

0 comments on commit 93d6e1b

Please sign in to comment.