From: Ron Koenderink Date: Fri, 28 Mar 2008 02:07:11 +0000 (-0600) Subject: Add missing thread yield system call. X-Git-Tag: v4.3.12~7 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=9a4f49f128d80e25800783f52487d4a7046e41c3 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. --- diff --git a/src/lib/empthread/ntthread.c b/src/lib/empthread/ntthread.c index 7187ab649..c642af062 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); }