From 9a4f49f128d80e25800783f52487d4a7046e41c3 Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Thu, 27 Mar 2008 20:07:11 -0600 Subject: [PATCH] Add missing thread yield system call. This change fixes a bug where the threads were not treated fairly. Before the fix, empth_yield would only yield to threads already waiting hThreadMutex mutex. It would not yield to other threads ready to run from the release of other mutexes. An example of this is that the update task did not start when force command was issued from script sequence. --- src/lib/empthread/ntthread.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/empthread/ntthread.c b/src/lib/empthread/ntthread.c index 7187ab64..c642af06 100644 --- a/src/lib/empthread/ntthread.c +++ b/src/lib/empthread/ntthread.c @@ -510,6 +510,7 @@ void empth_yield(void) { loc_BlockThisThread(); + Sleep(0); loc_RunThisThread(NULL); }