diff options
| author | John Peterson <jpeterson57@gmail.com> | 2009-02-22 21:16:12 +0000 |
|---|---|---|
| committer | John Peterson <jpeterson57@gmail.com> | 2009-02-22 21:16:12 +0000 |
| commit | 927815bc9b8ed86f3e8d56c8ae8707f21684fc5e (patch) | |
| tree | 0f11893560dd7cf8cefbc8291eeb361c9f8a56f6 /Source/Core/VideoCommon/Src/Fifo.cpp | |
| parent | 769160dfbd370d22383dca76fb16cadee6ecca9c (diff) | |
Core Stop and Start: Added alternative separate thread timer/loop based waiting, instead of same thread loop waiting. You can try it with the SETUP_TIMER_WAITING option in Setup.h.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2375 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/VideoCommon/Src/Fifo.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Src/Fifo.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/Src/Fifo.cpp b/Source/Core/VideoCommon/Src/Fifo.cpp index 8c2940f9af..168d893cdd 100644 --- a/Source/Core/VideoCommon/Src/Fifo.cpp +++ b/Source/Core/VideoCommon/Src/Fifo.cpp @@ -17,10 +17,14 @@ #include <string.h> +#include "Setup.h" +#ifdef SETUP_TIMER_WAITING + #include "../../../Plugins/Plugin_VideoOGL/Src/OS/Win32.h" +#endif #include "MemoryUtil.h" #include "Thread.h" #include "OpcodeDecoding.h" -#include "Setup.h" +#include "ConsoleWindow.h" #include "Fifo.h" @@ -96,8 +100,18 @@ void Video_SendFifoData(u8* _uData, u32 len) void Fifo_ExitLoop() { fifoStateRun = false; - fifo_exit_event.Wait(); - fifo_exit_event.Shutdown(); + #ifndef SETUP_TIMER_WAITING + fifo_exit_event.Wait(); + fifo_exit_event.Shutdown(); + #else + //Console::Print("Video: Fifo_ExitLoop: Done:%i\n", fifo_exit_event.DoneWait()); + if (fifo_exit_event.TimerWait(Fifo_ExitLoop)) + { + //Console::Print("Video: Fifo_Shutdown: Done:%i\n\n", fifo_exit_event.DoneWait()); + fifo_exit_event.Shutdown(); + PostMessage(EmuWindow::GetParentWnd(), WM_USER, OPENGL_VIDEO_STOP, 0); + } + #endif } void Fifo_EnterLoop(const SVideoInitialize &video_initialize) @@ -111,6 +125,7 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize) #if defined(_WIN32) && !defined(SETUP_AVOID_OPENGL_SCREEN_MESSAGE_HANG) video_initialize.pPeekMessages(); #endif + if (_fifo.CPReadWriteDistance == 0) Common::SleepCurrentThread(1); @@ -187,4 +202,7 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize) } } fifo_exit_event.Set(); + #ifdef SETUP_TIMER_WAITING + fifo_exit_event.SetTimer(); + #endif } |
