mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 15:20:17 +01:00
c11/threads: initialize timeout structure
Signed-off-by: Jan Vesely <jano.vesely@gmail.com> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
89ae41ab4c
commit
c8031a879a
1 changed files with 6 additions and 0 deletions
|
|
@ -136,8 +136,14 @@ cnd_timedwait(cnd_t *cond, mtx_t *mtx, const xtime *xt)
|
|||
{
|
||||
struct timespec abs_time;
|
||||
int rt;
|
||||
|
||||
assert(mtx != NULL);
|
||||
assert(cond != NULL);
|
||||
assert(xt != NULL);
|
||||
|
||||
abs_time.tv_sec = xt->sec;
|
||||
abs_time.tv_nsec = xt->nsec;
|
||||
|
||||
rt = pthread_cond_timedwait(cond, mtx, &abs_time);
|
||||
if (rt == ETIMEDOUT)
|
||||
return thrd_busy;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue