This didn't show up in the archives, so trying again.

>From 7882df972ec827f0e7b7b622c01be2644e54d122 Mon Sep 17 00:00:00 2001
From: Joakim Tjernlund <joakim.tjernl...@transmode.se>
Date: Mon, 3 May 2010 20:30:32 +0200
Subject: [PATCH] RegisterWaitForSingleObject() fix special tmo == 0 case.

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.tjernl...@transmode.se>
---
 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




Reply via email to