From dbf7f554b1b7822bd68a6d88919d0b2406eed0f8 Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Sun, 30 Sep 2007 15:39:48 +0000 Subject: [PATCH] (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. --- src/lib/empthread/ntthread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/empthread/ntthread.c b/src/lib/empthread/ntthread.c index bc2e9d9c..4f736949 100644 --- a/src/lib/empthread/ntthread.c +++ b/src/lib/empthread/ntthread.c @@ -601,7 +601,7 @@ empth_sleep(time_t until) empth_t *pThread = TlsGetValue(dwTLSIndex); int iReturn = 0; - if ((lSec = until - time(0)) > 0) { + while (!iReturn && ((lSec = until - time(0)) > 0)) { loc_BlockThisThread(); loc_debug("going to sleep %ld sec", lSec);