--Fixed some problems on the win32 threading code, handle can be NULL, the error value is INVALID_HANDLE_VALUE. --Don't call GS_SETEVENT from CSRwrite, because it calls SetEvent and thats a kernel function that sometimes corrupts the contents of the xmm regs.Since CSRwrite is called directly from the dynarec context without flushing the xmm regs that can lead to register corruption :p.Fixes PAL FFX on my pc [got broken on 376 and up]

git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@394 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
drkIIRaziel 2008-12-05 15:18:47 +00:00 committed by Gregory Hainaut
parent b8e4a35de6
commit 1753d21df4
1 changed files with 3 additions and 4 deletions

View File

@ -54,12 +54,12 @@ GS_THREADPROC; // forward declaration of the gs threadproc
static bool thread_create( thread_t& thread )
{
thread = CreateThread(NULL, 0, GSThreadProc, NULL, 0, NULL);
return thread != NULL;
return thread != INVALID_HANDLE_VALUE;
}
static void thread_close( thread_t& thread )
{
if( thread == NULL ) return;
if( thread == INVALID_HANDLE_VALUE ) return;
while( true )
{
DWORD status;
@ -68,7 +68,7 @@ static void thread_close( thread_t& thread )
Sleep( 3 );
}
CloseHandle( thread );
thread = NULL;
thread = INVALID_HANDLE_VALUE;
}
static void event_init( wait_event_t& evt )
@ -771,7 +771,6 @@ void CSRwrite(u32 value)
if( CHECK_MULTIGS )
{
GSRingBufSimplePacket( GS_RINGTYPE_WRITECSR, CSRw, 0, 0 );
GS_SETEVENT();
}
else
GSwriteCSR(CSRw);