Mesa (master): c11/threads: initialize timeout structure

Emil Velikov evelikov at kemper.freedesktop.org
Thu Oct 8 13:02:05 UTC 2015


Module: Mesa
Branch: master
Commit: c8031a879a3f442a4ca43243914c797615110d9b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c8031a879a3f442a4ca43243914c797615110d9b

Author: Jan Vesely <jano.vesely at gmail.com>
Date:   Sat Oct  3 19:19:13 2015 -0500

c11/threads: initialize timeout structure

Signed-off-by: Jan Vesely <jano.vesely at gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 include/c11/threads_posix.h |    6 ++++++
 1 file changed, 6 insertions(+)

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;




More information about the mesa-commit mailing list