From: Jan Vesely Date: Sun, 4 Oct 2015 00:19:13 +0000 (-0500) Subject: c11/threads: initialize timeout structure X-Git-Tag: upstream/17.1.0~15517 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c8031a879a3f442a4ca43243914c797615110d9b;p=platform%2Fupstream%2Fmesa.git c11/threads: initialize timeout structure Signed-off-by: Jan Vesely Reviewed-by: Ian Romanick --- diff --git a/include/c11/threads_posix.h b/include/c11/threads_posix.h index 3def6c4..ce9853b 100644 --- a/include/c11/threads_posix.h +++ b/include/c11/threads_posix.h @@ -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;