From d65a05e895c94f4c89e17f41809e25668217da9b Mon Sep 17 00:00:00 2001 From: davidxu Date: Wed, 23 Nov 2011 11:59:01 +0000 Subject: [PATCH] MFC r227604: Pass CVWAIT flags to kernel, this should handle Timeout correctly for pthread_cond_timedwait when it uses kernel-based condition variable. Approved by: re (kib) git-svn-id: svn://svn.freebsd.org/base/releng/9.0@227877 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- lib/libthr/thread/thr_umtx.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/libthr/thread/thr_umtx.c b/lib/libthr/thread/thr_umtx.c index 33c36376..e9623782 100644 --- a/lib/libthr/thread/thr_umtx.c +++ b/lib/libthr/thread/thr_umtx.c @@ -231,7 +231,7 @@ _thr_ucond_init(struct ucond *cv) int _thr_ucond_wait(struct ucond *cv, struct umutex *m, - const struct timespec *timeout, int check_unparking) + const struct timespec *timeout, int flags) { if (timeout && (timeout->tv_sec < 0 || (timeout->tv_sec == 0 && timeout->tv_nsec <= 0))) { @@ -239,8 +239,7 @@ _thr_ucond_wait(struct ucond *cv, struct umutex *m, _thr_umutex_unlock(m, TID(curthread)); return (ETIMEDOUT); } - return _umtx_op_err(cv, UMTX_OP_CV_WAIT, - check_unparking ? UMTX_CHECK_UNPARKING : 0, + return _umtx_op_err(cv, UMTX_OP_CV_WAIT, flags, m, __DECONST(void*, timeout)); } -- 2.42.0