(empth_sleep) [_WIN32]: Change if to while to ensure the time has

actually been reached.  There has been examples where the time
expired early by one second probably due a resolution error.  This
caused a scheduled update to be missed.  Broken in rev. 1.56.
This commit is contained in:
Ron Koenderink 2007-09-30 15:39:48 +00:00
parent e218d6b841
commit dbf7f554b1

View file

@ -601,7 +601,7 @@ empth_sleep(time_t until)
empth_t *pThread = TlsGetValue(dwTLSIndex); empth_t *pThread = TlsGetValue(dwTLSIndex);
int iReturn = 0; int iReturn = 0;
if ((lSec = until - time(0)) > 0) { while (!iReturn && ((lSec = until - time(0)) > 0)) {
loc_BlockThisThread(); loc_BlockThisThread();
loc_debug("going to sleep %ld sec", lSec); loc_debug("going to sleep %ld sec", lSec);