Cocoa Port:
- Fix potential deadlock on application exit. - Misc. code cleanup.
This commit is contained in:
parent
f6f1678eca
commit
7f6e9074f4
|
@ -26,6 +26,7 @@
|
|||
#include <mach/mach.h>
|
||||
#include <mach/mach_time.h>
|
||||
|
||||
#include "../addons.h"
|
||||
#include "../NDSSystem.h"
|
||||
#undef BOOL
|
||||
|
||||
|
@ -165,6 +166,8 @@ static BOOL isCoreStarted = NO;
|
|||
return isCoreStarted;
|
||||
}
|
||||
|
||||
addonsChangePak(NDS_ADDON_NONE);
|
||||
|
||||
result = NDS_Init();
|
||||
if (result == -1)
|
||||
{
|
||||
|
@ -665,6 +668,7 @@ static void* RunCoreThread(void *arg)
|
|||
|
||||
if (param->exitThread)
|
||||
{
|
||||
pthread_mutex_unlock(¶m->mutexThreadExecute);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -716,10 +720,7 @@ static void* RunCoreThread(void *arg)
|
|||
pthread_mutex_unlock(¶m->mutexThreadExecute);
|
||||
|
||||
// If there is any time left in the loop, go ahead and pad it.
|
||||
if(timeBudget > (mach_absolute_time() - startTime))
|
||||
{
|
||||
mach_wait_until(startTime + timeBudget);
|
||||
}
|
||||
|
||||
} while (!param->exitThread);
|
||||
|
||||
|
|
Loading…
Reference in New Issue