wine CPU usage and CreateWaitableTimer

Nikolay Sivov nsivov at codeweavers.com
Fri Jun 26 02:27:18 CDT 2015


On 06/25/2015 10:47 PM, andrea wrote:
> On 07/06/15 19:08, Sebastian Lackner wrote:
>> Hello andrea,
>>
>> good catch, its actually a bug in SystemClockAdviseThread. A patch like:
>>
>> --- snip ---
>> diff --git a/dlls/quartz/systemclock.c b/dlls/quartz/systemclock.c
>> index 043299b..ac41a49 100644
>> --- a/dlls/quartz/systemclock.c
>> +++ b/dlls/quartz/systemclock.c
>> @@ -127,6 +127,7 @@ static DWORD WINAPI SystemClockAdviseThread(LPVOID
>> lpParam) {
>>         it = nextit;
>>       }
>>       if (NULL != it) timeOut = (DWORD) ((it->rtBaseTime +
>> it->rtIntervalTime) - curTime) / (REFERENCE_TIME)10000;
>> +    else timeOut = INFINITE;
>>
>>       /** Now Periodics Advice: semi sorted list (sort cannot be used) */
>>       for (it = This->pPeriodicAdvise; NULL != it; it = it->next) {
>> --- snip ---
>>
>> Seems to be sufficient to fix it. I will review the code for other
>> errors one more time,
>> and then submit the patch.
>>
>> Regarding your second question, the best timer (when using for events) is
>> CreateWaitableTimer in my opinion. All other timers need separate
>> threads, and need an
>> additional wineserver call for event handling.
>>
>> Regards,
>> Sebastian
>
> Did you manage to check if the patch you proposed is the good one?
>

This particular patch is already in wine, 
http://source.winehq.org/git/wine.git/commit/b513e07c55504f623baf8d838d00ac628eac7614.



More information about the wine-devel mailing list