From 8992e5e1b9b6aa3b0997a9e51a0bde2061dddbbe Mon Sep 17 00:00:00 2001 From: "SND\\weimingzhi_cp" Date: Sun, 31 Jan 2010 12:23:27 +0000 Subject: git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@40988 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- ChangeLog | 7 ++++++- macosx/EmuThread.m | 26 ++++++++++++-------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index cdf092e9..0610e41c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,12 @@ +January 31, 2010 Wei Mingzhi + + * macosx/EmuThread.m: Use setjmp()/longjmp() for resetting to avoid nasty + plugin issues. + January 24, 2010 Wei Mingzhi * gui/LnxMain.c: Don't always move the mouse to the right for screensaver - disabling. + disabling. * win32/pcsx.sln, win32/pcsx.vcproj: Added VC8 Project File. January 23, 2010 Wei Mingzhi diff --git a/macosx/EmuThread.m b/macosx/EmuThread.m index 4818ff1a..7cbb7a32 100644 --- a/macosx/EmuThread.m +++ b/macosx/EmuThread.m @@ -77,7 +77,7 @@ static pthread_mutex_t eventMutex; done: [pool release]; pool = nil; emuThread = nil; - + return; } @@ -121,10 +121,10 @@ done: { // remove all registered observers [[NSNotificationCenter defaultCenter] removeObserver:self name:nil object:nil]; - + if (pool) [pool release]; - + [super dealloc]; } @@ -171,11 +171,11 @@ done: } if (safeEvent & EMUEVENT_RESET) { -#if 1 +#if 0 /* signify that the emulation has stopped */ [emuThread autorelease]; emuThread = nil; - + /* better unlock the mutex before killing ourself */ pthread_mutex_unlock(&eventMutex); @@ -183,14 +183,14 @@ done: // start a new emulation thread [EmuThread run]; - + //[[NSThread currentThread] autorelease]; [NSThread exit]; return; #else safeEvent &= ~EMUEVENT_RESET; pthread_mutex_unlock(&eventMutex); - + psxCpu->Reset(); longjmp(restartJmp, 0); @@ -334,7 +334,7 @@ done: pthread_mutex_lock(&eventMutex); safeEvent = EMUEVENT_RESET; pthread_mutex_unlock(&eventMutex); - + pthread_cond_broadcast(&eventCond); } @@ -374,13 +374,13 @@ done: { BOOL emuWasPaused = [EmuThread pauseSafe]; char Text[256]; - + GPU_freeze(2, (GPUFreeze_t *)&num); int ret = SaveState([path fileSystemRepresentation]); if (ret == 0) sprintf (Text, _("*PCSX*: Saved State %d"), num+1); else sprintf (Text, _("*PCSX*: Error Saving State %d"), num+1); GPU_displayText(Text); - + if (!emuWasPaused) { [EmuThread resume]; } @@ -391,13 +391,11 @@ done: const char *cPath = [path fileSystemRepresentation]; if (CheckState(cPath) != 0) return NO; - + defrostPath = [path retain]; - [EmuThread reset]; - - GPU_displayText(_("*PCSX*: Loaded State")); + GPU_displayText(_("*PCSX*: Loaded State")); return YES; } -- cgit v1.2.3