Zebediah Figura : quartz/systemclock: Also wake the semaphore at the given start time.
Alexandre Julliard
julliard at winehq.org
Fri Mar 15 15:20:00 CDT 2019
Module: wine
Branch: master
Commit: b5eff130a7ad8211e91f25f1fe429a81b52ff7de
URL: https://source.winehq.org/git/wine.git/?a=commit;h=b5eff130a7ad8211e91f25f1fe429a81b52ff7de
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Thu Mar 14 19:11:00 2019 -0500
quartz/systemclock: Also wake the semaphore at the given start time.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/quartz/systemclock.c | 4 ++--
dlls/quartz/tests/systemclock.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c
index 8291fe5..c445f57 100644
--- a/dlls/quartz/systemclock.c
+++ b/dlls/quartz/systemclock.c
@@ -106,11 +106,11 @@ static DWORD WINAPI SystemClockAdviseThread(LPVOID lpParam) {
{
if (sink->rtBaseTime <= curTime)
{
- DWORD periods = (curTime - sink->rtBaseTime) / sink->rtIntervalTime;
+ DWORD periods = ((curTime - sink->rtBaseTime) / sink->rtIntervalTime) + 1;
ReleaseSemaphore(sink->hEvent, periods, NULL);
sink->rtBaseTime += periods * sink->rtIntervalTime;
}
- timeOut = min(timeOut, ((sink->rtBaseTime + sink->rtIntervalTime) - curTime) / 10000);
+ timeOut = min(timeOut, (sink->rtBaseTime - curTime) / 10000);
}
LeaveCriticalSection(&This->safe);
diff --git a/dlls/quartz/tests/systemclock.c b/dlls/quartz/tests/systemclock.c
index 77e6c63..cd291e1 100644
--- a/dlls/quartz/tests/systemclock.c
+++ b/dlls/quartz/tests/systemclock.c
@@ -160,7 +160,7 @@ static void test_advise(void)
hr = IReferenceClock_AdvisePeriodic(clock, current, 500 * 10000, (HSEMAPHORE)semaphore, &cookie);
ok(hr == S_OK, "Got hr %#x.\n", hr);
- todo_wine ok(!WaitForSingleObject(semaphore, 10), "Semaphore should be signaled.\n");
+ ok(!WaitForSingleObject(semaphore, 10), "Semaphore should be signaled.\n");
for (i = 0; i < 5; ++i)
{
ok(WaitForSingleObject(semaphore, 480) == WAIT_TIMEOUT, "Semaphore should not be signaled.\n");
More information about the wine-cvs
mailing list