Attempt to workaround some stop hangs by using MsgWait instead of Wait. change order of dsp / video shutdown. some comments.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2379 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2009-02-22 22:49:42 +00:00
parent a32e29aaa5
commit 68f5cc1873
9 changed files with 89 additions and 44 deletions

View File

@ -35,7 +35,7 @@ extern u8* g_pVideoData;
namespace {
static bool fifoStateRun = false;
static volatile bool fifoStateRun = false;
static u8 *videoBuffer;
static Common::Event fifo_exit_event;
// STATE_TO_SAVE
@ -97,11 +97,16 @@ void Video_SendFifoData(u8* _uData, u32 len)
OpcodeDecoder_Run();
}
// Executed from another thread, no the graphics thread!
// Basically, all it does is set a flag so that the loop will eventually exit, then
// waits for the event to be set, which happens when the loop does exit.
// If we look stuck in here, then the video thread is stuck in something and won't exit
// the loop. Switch to the video thread and investigate.
void Fifo_ExitLoop()
{
fifoStateRun = false;
#ifndef SETUP_TIMER_WAITING
fifo_exit_event.Wait();
fifo_exit_event.MsgWait();
fifo_exit_event.Shutdown();
#else
//Console::Print("Video: Fifo_ExitLoop: Done:%i\n", fifo_exit_event.DoneWait());
@ -114,6 +119,7 @@ void Fifo_ExitLoop()
#endif
}
//
void Fifo_EnterLoop(const SVideoInitialize &video_initialize)
{
fifoStateRun = true;