quartz: Reset the advise thread's timeout on each iteration.

Fixes a regression introduced by
63a6b308e9. Because the timeout value was
always shrinked, it quickly went to 0 and then the entire advise thread
used 100% of a CPU core in applications such as Media Player Classic by
basically becoming a busy loop.

Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gabriel Ivăncescu 2020-01-02 15:07:44 +02:00 committed by Alexandre Julliard
parent 3772c620b0
commit 14435a6d31
1 changed files with 2 additions and 1 deletions

View File

@ -126,13 +126,14 @@ static DWORD WINAPI SystemClockAdviseThread(void *param)
struct system_clock *clock = param;
struct advise_sink *sink, *cursor;
REFERENCE_TIME current_time;
DWORD timeout = INFINITE;
HANDLE handles[2] = {clock->stop_event, clock->notify_event};
TRACE("Starting advise thread for clock %p.\n", clock);
for (;;)
{
DWORD timeout = INFINITE;
EnterCriticalSection(&clock->cs);
current_time = GetTickCount64() * 10000;