Commit b5eff130 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

quartz/systemclock: Also wake the semaphore at the given start time.

parent 9ff0c09e
......@@ -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);
......
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment