Skip to content
Snippets Groups Projects
Commit c0a51bce authored by Steve Lhomme's avatar Steve Lhomme
Browse files

win32: thread: don't rely on the precision of vlc_tick_now to timeout

This also saves a call to vlc_tick_now() on timeout.
parent 289075fa
No related branches found
No related tags found
1 merge request!2396win32: thread: simplify the millisecond waits
Pipeline #253496 passed with stage
in 16 minutes and 40 seconds
......@@ -293,6 +293,8 @@ int vlc_atomic_timedwait(void *addr, unsigned val, vlc_tick_t deadline)
if (WaitOnAddress(addr, &val, sizeof (val), ms))
return 0;
if (GetLastError() == ERROR_TIMEOUT)
return ETIMEDOUT;
}
}
......@@ -316,6 +318,8 @@ int vlc_atomic_timedwait_daytime(void *addr, unsigned val, time_t deadline)
if (WaitOnAddress(addr, &val, sizeof (val), ms))
return 0;
if (GetLastError() == ERROR_TIMEOUT)
return ETIMEDOUT;
}
}
......@@ -631,6 +635,8 @@ void (vlc_tick_wait)(vlc_tick_t deadline)
vlc_docancel(th);
}
#endif
if (delay_ms != ULONG_MAX)
break;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment