On Fri Oct 6 18:00:23 2023 +0000, Connor McAdams wrote:
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.
What about an event instead? So basically, in `uia_com_win_event_clientside_provider_callback` you would set an event. Then in this loop:
* WaitForSingleObject on the event with a timeout of `TIME_SINCE_LAST_CALLBACK_TIMEOUT`. * Return TRUE if the full timeout elapsed. * Return FALSE if WaitForSingleObject timed out. * Else, continue.