From fe9e72d6dcfc86bb75b14be9c1ea686e9e8205c2 Mon Sep 17 00:00:00 2001 From: Soren Jorvang Date: Sun, 19 Dec 2010 16:07:05 +0000 Subject: [PATCH] Lock emulation while saving state on all platforms. Fixes issue 2805. Fixes issue 3235. If this causes problems on Windows, just use this intead: #if defined(HAVE_X11) && HAVE_X11 || defined __APPLE__ git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6614 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/MainBase.cpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Source/Core/VideoCommon/Src/MainBase.cpp b/Source/Core/VideoCommon/Src/MainBase.cpp index b57d59c80d..8a6411b438 100644 --- a/Source/Core/VideoCommon/Src/MainBase.cpp +++ b/Source/Core/VideoCommon/Src/MainBase.cpp @@ -164,9 +164,7 @@ u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 InputData) return 0; } -#if defined(HAVE_X11) && HAVE_X11 static volatile u32 s_doStateRequested = FALSE; -#endif static volatile struct { @@ -176,10 +174,8 @@ static volatile struct // Run from the GPU thread on X11, CPU thread on the rest static void check_DoState() { -#if defined(HAVE_X11) && HAVE_X11 if (Common::AtomicLoadAcquire(s_doStateRequested)) { -#endif // Clear all caches that touch RAM CommandProcessor::FifoCriticalEnter(); TextureCache::Invalidate(false); @@ -196,10 +192,8 @@ static void check_DoState() { RecomputeCachedArraybases(); } -#if defined(HAVE_X11) && HAVE_X11 Common::AtomicStoreRelease(s_doStateRequested, FALSE); } -#endif } // Run from the CPU thread @@ -207,7 +201,6 @@ void DoState(unsigned char **ptr, int mode) { s_doStateArgs.ptr = ptr; s_doStateArgs.mode = mode; -#if defined(HAVE_X11) && HAVE_X11 Common::AtomicStoreRelease(s_doStateRequested, TRUE); if (g_VideoInitialize.bOnThread) { @@ -216,7 +209,6 @@ void DoState(unsigned char **ptr, int mode) Common::YieldCPU(); } else -#endif check_DoState(); } @@ -224,9 +216,7 @@ void VideoFifo_CheckAsyncRequest() { VideoFifo_CheckSwapRequest(); VideoFifo_CheckEFBAccess(); -#if defined(HAVE_X11) && HAVE_X11 - check_DoState(); -#endif + check_DoState(); } void Video_CommandProcessorRead16(u16& _rReturnValue, const u32 _Address)