Commit da5779e5 authored by Ulrich Weigand's avatar Ulrich Weigand Committed by Alexandre Julliard

Allow UserYield16 to be called from 32-bit thread.

parent 8de1dfa7
......@@ -1074,12 +1074,6 @@ void WINAPI Yield16(void)
{
TDB *pCurTask = (TDB *)GlobalLock16( GetCurrentTask() );
if ( !THREAD_IsWin16( THREAD_Current() ) )
{
FIXME(task, "called for Win32 thread (%04x)!\n", THREAD_Current()->teb_sel);
return;
}
if (pCurTask) pCurTask->hYieldTo = 0;
if (pCurTask && pCurTask->hQueue) Callout.UserYield16();
else OldYield16();
......
......@@ -1487,25 +1487,28 @@ BOOL WINAPI GetInputState(void)
*/
void WINAPI UserYield16(void)
{
TDB *pCurTask = (TDB *)GlobalLock16( GetCurrentTask() );
MESSAGEQUEUE *queue = (MESSAGEQUEUE *)QUEUE_Lock( pCurTask->hQueue );
if ( !THREAD_IsWin16( THREAD_Current() ) )
{
FIXME(task, "called for Win32 thread (%04x)!\n", THREAD_Current()->teb_sel);
QUEUE_Unlock( queue );
return;
}
MESSAGEQUEUE *queue;
/* Handle sent messages */
queue = (MESSAGEQUEUE *)QUEUE_Lock( GetFastQueue16() );
while (queue && (queue->wakeBits & QS_SENDMESSAGE))
QUEUE_ReceiveMessage( queue );
QUEUE_Unlock( queue );
OldYield16();
/* Yield */
if ( THREAD_IsWin16( THREAD_Current() ) )
OldYield16();
else
{
SYSLEVEL_LeaveWin16Lock();
SYSLEVEL_EnterWin16Lock();
}
/* Handle sent messages again */
queue = (MESSAGEQUEUE *)QUEUE_Lock( GetFastQueue16() );
queue = (MESSAGEQUEUE *)QUEUE_Lock( pCurTask->hQueue );
while (queue && (queue->wakeBits & QS_SENDMESSAGE))
QUEUE_ReceiveMessage( queue );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment