OpenGL: Added a Setup.h option to avoid another annoying WaitForSingleObject() hanging. WaitForSingleObject() in Fifo_ExitLoop() would hang the thread it was waiting for when it arrived at Callback_PeekMessages(). Can't these waiting loops be replaced by a timer somehow? They are pretty ineffective if they hang the loop they are waiting for all the time.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2359 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
2a94635523
commit
42101f0ce6
|
@ -46,6 +46,9 @@
|
||||||
window, however, I didn't seem to need this any more */
|
window, however, I didn't seem to need this any more */
|
||||||
//#define SETUP_AVOID_CHILD_WINDOW_RENDERING_HANG
|
//#define SETUP_AVOID_CHILD_WINDOW_RENDERING_HANG
|
||||||
|
|
||||||
|
// Build with playback rerecording options
|
||||||
|
//#define SETUP_AVOID_OPENGL_SCREEN_MESSAGE_HANG
|
||||||
|
|
||||||
// Build with playback rerecording options
|
// Build with playback rerecording options
|
||||||
//#define RERECORDING
|
//#define RERECORDING
|
||||||
|
|
||||||
|
|
|
@ -469,6 +469,10 @@ THREAD_RETURN EmuThread(void *pArg)
|
||||||
// We have now exited the Video Loop and will shut down
|
// We have now exited the Video Loop and will shut down
|
||||||
|
|
||||||
// does this comment still apply?
|
// does this comment still apply?
|
||||||
|
/* JP: Perhaps not, but it's not the first time one of these waiting loops have failed. They seem inherently
|
||||||
|
dysfunctional because they can hang the very thread they are waiting for, so they should be replaced by timers like I did
|
||||||
|
in the Wiimote plugin. Or any alterantive that does not hang the thread it's waiting for. Sleep() hangs the other thread to,
|
||||||
|
just like a loop, so that is not an option. */
|
||||||
/* Check if we are using single core and are rendering to the main window. In that case we must avoid the WaitForSingleObject()
|
/* Check if we are using single core and are rendering to the main window. In that case we must avoid the WaitForSingleObject()
|
||||||
loop in the cpu thread thread, because it will hang on occation, perhaps one time in three or so. I had this problem in the Wiimote plugin, what happened was that if I entered the
|
loop in the cpu thread thread, because it will hang on occation, perhaps one time in three or so. I had this problem in the Wiimote plugin, what happened was that if I entered the
|
||||||
WaitForSingleObject loop or any loop at all in the main thread, the separate thread would halt at a place where it called a function in
|
WaitForSingleObject loop or any loop at all in the main thread, the separate thread would halt at a place where it called a function in
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "MemoryUtil.h"
|
#include "MemoryUtil.h"
|
||||||
#include "Thread.h"
|
#include "Thread.h"
|
||||||
#include "OpcodeDecoding.h"
|
#include "OpcodeDecoding.h"
|
||||||
|
#include "Setup.h"
|
||||||
|
|
||||||
#include "Fifo.h"
|
#include "Fifo.h"
|
||||||
|
|
||||||
|
@ -107,7 +108,7 @@ void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
|
||||||
|
|
||||||
while (fifoStateRun)
|
while (fifoStateRun)
|
||||||
{
|
{
|
||||||
#ifdef _WIN32
|
#if defined(_WIN32) && !defined(SETUP_AVOID_OPENGL_SCREEN_MESSAGE_HANG)
|
||||||
video_initialize.pPeekMessages();
|
video_initialize.pPeekMessages();
|
||||||
#endif
|
#endif
|
||||||
if (_fifo.CPReadWriteDistance == 0)
|
if (_fifo.CPReadWriteDistance == 0)
|
||||||
|
|
Loading…
Reference in New Issue