]> git.pond.sub.org Git - empserver/commitdiff
Add missing thread yield system call.
authorRon Koenderink <rkoenderink@yahoo.ca>
Fri, 28 Mar 2008 02:07:11 +0000 (20:07 -0600)
committerRon Koenderink <rkoenderink@yahoo.ca>
Fri, 28 Mar 2008 02:07:11 +0000 (20:07 -0600)
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

index 7187ab649e216999363282bc6ac1efef7b5b46d2..c642af0622e418ed9079a725dcfd4c7eb33b76f4 100644 (file)
@@ -510,6 +510,7 @@ void
 empth_yield(void)
 {
     loc_BlockThisThread();
 empth_yield(void)
 {
     loc_BlockThisThread();
+    Sleep(0);
     loc_RunThisThread(NULL);
 }
 
     loc_RunThisThread(NULL);
 }