Skip to content

win32: thread: simplify the millisecond waits

Steve Lhomme requested to merge robUx4/vlc:win32-wait into master

Following this remark, I factorized the code in vlc_tick_wait() to always use vlc_atomic_timedwait() even on Win7+ builds running on Win7.

Also cleaned up the milliseconds passed as DWORD in Windows API. DWORD is an unsigned long so we can put up to ULONG_MAX in it.

And exit early when we know a call timed out. No need to call vlc_tick_now() and its fluctuating precision to know that yes we timed out.


v2:

  • removed the Win7 use of WaitOnAddress for vlc_tick_wait()
  • fix the rounding of the vlc_tick_wait() delay in win7/non killable threads
Edited by Steve Lhomme

Merge request reports

Loading