Fixed some deadlock(s) in message sending.

This commit is contained in:
Eric Pouech 1999-05-03 09:44:57 +00:00 committed by Alexandre Julliard
parent b068320abd
commit 8c38f45a7e
1 changed files with 15 additions and 4 deletions

View File

@ -701,8 +701,19 @@ int QUEUE_WaitBits( WORD bits, DWORD timeout )
if ( !THREAD_IsWin16( THREAD_Current() ) )
{
/* win32 thread, use WaitForMultipleObjects */
MsgWaitForMultipleObjects( 0, NULL, FALSE, timeout, queue->wakeMask );
BOOL bHasWin16Lock;
DWORD dwlc;
if ( (bHasWin16Lock = _ConfirmWin16Lock()) )
{
TRACE_(msg)("bHasWin16Lock=TRUE\n");
ReleaseThunkLock( &dwlc );
}
WaitForSingleObject( queue->hEvent, timeout );
if ( bHasWin16Lock )
{
RestoreThunkLock( dwlc );
}
}
else
{
@ -714,14 +725,14 @@ int QUEUE_WaitBits( WORD bits, DWORD timeout )
if (GetTickCount() - curTime > timeout)
{
QUEUE_Unlock( queue );
QUEUE_Unlock( queue );
return 0; /* exit with timeout */
}
Yield16();
}
}
}
}
}
/***********************************************************************