From eded81ac8a46a6948a18bea53bb9388f519c052b Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Sat, 15 Nov 2014 03:44:07 +0000 Subject: [PATCH] OS X: change the dispatch_async in the freeze block to dispatch_after. This makes it look cleaner. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@92247 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/Source/PcsxrController.m | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/macosx/Source/PcsxrController.m b/macosx/Source/PcsxrController.m index 64067c54..a9c61523 100644 --- a/macosx/Source/PcsxrController.m +++ b/macosx/Source/PcsxrController.m @@ -589,10 +589,7 @@ otherblock();\ NSString *path = FileTestBlock(); LaunchArg *larg = [[LaunchArg alloc] initWithLaunchOrder:LaunchArgPostRun argument:kPCSXRArgumentFreeze block:^{ if (![EmuThread isRunBios]) { - // TODO: use another API to put up a timer, instead of sleeping - dispatch_async(dispatch_get_global_queue(0, 0), ^{ - //Make sure the emulator is running - sleep(5); + dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_global_queue(0, 0), ^{ [EmuThread defrostAt:path]; }); }