svn commit: r227604 - head/lib/libthr/thread

David Xu davidxu at FreeBSD.org
Thu Nov 17 01:43:51 UTC 2011


Author: davidxu
Date: Thu Nov 17 01:43:50 2011
New Revision: 227604
URL: http://svn.freebsd.org/changeset/base/227604

Log:
  Pass CVWAIT flags to kernel, this should handle
  timeout correctly for pthread_cond_timedwait when
  it uses kernel-based condition variable.
  
  PR:	162403
  Submitted by: jilles
  MFC after: 3 days

Modified:
  head/lib/libthr/thread/thr_umtx.c

Modified: head/lib/libthr/thread/thr_umtx.c
==============================================================================
--- head/lib/libthr/thread/thr_umtx.c	Thu Nov 17 01:10:16 2011	(r227603)
+++ head/lib/libthr/thread/thr_umtx.c	Thu Nov 17 01:43:50 2011	(r227604)
@@ -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
 		_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));
 }
  


More information about the svn-src-all mailing list