[PATCH] RegisterWaitForSingleObject() fix special tmo == 0 case.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At http://msdn.microsoft.com/en-us/library/aa332406%28VS.71%29.aspx one
can read:
"If the timeOutInterval parameter is not zero (0) and the executeOnlyOnce
parameter is false, the timer is reset every time the event is signaled
or the time-out interval elapses."

timeOutInterval == 0 makes the above false and the timer should NOT
be reset, fix that.

Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@xxxxxxxxxxxx>
---

 Forget the earlier patches, this feels like the right fix.

 dlls/ntdll/threadpool.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/threadpool.c b/dlls/ntdll/threadpool.c
index 44afb01..f6c9fb4 100644
--- a/dlls/ntdll/threadpool.c
+++ b/dlls/ntdll/threadpool.c
@@ -377,7 +377,8 @@ static DWORD CALLBACK wait_thread_proc(LPVOID Arg)
             wait_work_item->Callback( wait_work_item->Context, TimerOrWaitFired );
             wait_work_item->CallbackInProgress = FALSE;
 
-            if (wait_work_item->Flags & WT_EXECUTEONLYONCE)
+            if (!wait_work_item->Milliseconds ||
+                wait_work_item->Flags & WT_EXECUTEONLYONCE)
                 break;
         }
         else
-- 
1.6.4.4



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux