Makeing LLE-testing threads work with common::thread

still getting a deadlock somewhere...


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2786 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
nakeee 2009-03-29 09:35:40 +00:00
parent cc14b50aba
commit 2e748b4544
2 changed files with 8 additions and 21 deletions

View File

@ -37,11 +37,6 @@
#define NULL 0 #define NULL 0
#endif #endif
#ifndef _WIN32
#undef WITH_DSP_ON_THREAD
//TODO FIX
#endif
const char* reg_names[] = const char* reg_names[] =
{ {
// a0 // a0
@ -67,7 +62,7 @@ const char* reg_names[] =
void gdsp_dma(); void gdsp_dma();
#ifdef WITH_DSP_ON_THREAD #if WITH_DSP_ON_THREAD
Common::CriticalSection g_CriticalSection; Common::CriticalSection g_CriticalSection;
#endif #endif

View File

@ -44,7 +44,7 @@
PLUGIN_GLOBALS* globals = NULL; PLUGIN_GLOBALS* globals = NULL;
DSPInitialize g_dspInitialize; DSPInitialize g_dspInitialize;
Common::Thread *g_hDSPThread;
SoundStream *soundStream = NULL; SoundStream *soundStream = NULL;
@ -143,12 +143,8 @@ void DllDebugger(HWND _hParent, bool Show)
} }
/*// Regular thread // Regular thread
#ifdef _WIN32
DWORD WINAPI dsp_thread(LPVOID lpParameter)
#else
void* dsp_thread(void* lpParameter) void* dsp_thread(void* lpParameter)
#endif
{ {
while (1) while (1)
{ {
@ -161,11 +157,7 @@ void* dsp_thread(void* lpParameter)
} }
// Debug thread // Debug thread
#ifdef _WIN32
DWORD WINAPI dsp_thread_debug(LPVOID lpParameter)
#else
void* dsp_thread_debug(void* lpParameter) void* dsp_thread_debug(void* lpParameter)
#endif
{ {
#ifdef _WIN32 #ifdef _WIN32
@ -187,7 +179,6 @@ void* dsp_thread_debug(void* lpParameter)
return NULL; return NULL;
} }
*/
void DSP_DebugBreak() void DSP_DebugBreak()
{ {
#ifdef _WIN32 #ifdef _WIN32
@ -238,6 +229,7 @@ void Initialize(void *init)
fclose(t); fclose(t);
} }
*/ */
g_hDSPThread = new Common::Thread(dsp_thread, NULL);
soundStream = AudioCommon::InitSoundStream(g_Config.sBackend); soundStream = AudioCommon::InitSoundStream(g_Config.sBackend);
@ -246,6 +238,8 @@ void Initialize(void *init)
void DSP_StopSoundStream() void DSP_StopSoundStream()
{ {
delete g_hDSPThread;
g_hDSPThread = NULL;
} }
void Shutdown(void) void Shutdown(void)
@ -340,12 +334,10 @@ void DSP_WriteMailboxLow(bool _CPUMailbox, u16 _uLowMail)
void DSP_Update(int cycles) void DSP_Update(int cycles)
{ {
#ifdef _WIN32 #ifdef _WIN32
if (g_Dialog.CanDoStep()) if (g_Dialog.CanDoStep())
{ #endif
gdsp_runx(100); // cycles gdsp_runx(100); // cycles
}
#endif
} }