On Fri Oct 6 16:57:54 2023 +0000, Esme Povirk wrote:
We usually avoid comparisons like this for `GetTickCount()` values, because it can wrap around at 49.7 days uptime. Comparisons like `(cur_time - start_time) >= total_timeout` work correctly even in case of wraparound. Is there any reason to have `prev_last_callback_time` at all? What if we just set last_clientside_callback_time to start_time here and used that? I think the issue with getting rid of `prev_last_callback_time` here is that `last_clientside_callback_time` can (and likely will) be set on another thread. Which would be broken here anyways, seeing as we call:
cur_time = GetTickCount();
if (prev_last_callback_time < last_clientside_callback_time)
prev_last_callback_time = last_clientside_callback_time;
and set `prev_last_callback_time` _after_ we set `cur_time`, which could mean `last_clientside_callback_time` could potentially be written more recently than `cur_time`. This will need some thought to do properly. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/4024#note_47892