From d1e2239ff0202c628ab9662403fd88ff4e4760fe Mon Sep 17 00:00:00 2001 From: Ulrich Weigand Date: Thu, 15 Apr 1999 15:30:33 +0000 Subject: [PATCH] Bugfix: Always release the Win16Lock in TASK_Reschedule. --- loader/task.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/loader/task.c b/loader/task.c index 5624bd143d3..75dd7bf9f8d 100644 --- a/loader/task.c +++ b/loader/task.c @@ -780,8 +780,13 @@ BOOL TASK_Reschedule(void) if (hTask == hCurrentTask) { - TRACE(task, "returning to the current task(%04x)\n", hTask ); - return FALSE; /* Nothing to do */ + /* Allow Win32 threads to thunk down even while a Win16 task is + in a tight PeekMessage() or Yield() loop ... */ + SYSLEVEL_ReleaseWin16Lock(); + SYSLEVEL_RestoreWin16Lock(); + + TRACE(task, "returning to the current task(%04x)\n", hTask ); + return FALSE; /* Nothing to do */ } pNewTask = (TDB *)GlobalLock16( hTask ); TRACE(task, "Switching to task %04x (%.8s)\n",