Commit 3ea7102c authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

msvcp: Cast the wait time in _Cnd_timedwait to ULONG.

This prevents sign extending it when promoting it to ULONGLONG. This fixes high CPU usage in Wargaming Game Center that was caused by _Cnd_timedwait instantly returning timeout instead of waiting for the requested 30 days. Signed-off-by: 's avatarStefan Dösinger <stefan@codeweavers.com> Signed-off-by: 's avatarPiotr Caban <piotr@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 25e20ac8
......@@ -635,7 +635,7 @@ int __cdecl _Cnd_timedwait(_Cnd_arg_t cnd, _Mtx_arg_t mtx, const xtime *xt)
InterlockedExchangeAdd( (LONG *)&cv->Ptr, 1 );
_Mtx_unlock(mtx);
timeout.QuadPart = (ULONGLONG)_Xtime_diff_to_millis(xt) * -10000;
timeout.QuadPart = (ULONGLONG)(ULONG)_Xtime_diff_to_millis(xt) * -10000;
status = NtWaitForKeyedEvent(keyed_event, &cv->Ptr, FALSE, &timeout);
if (status)
{
......
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