Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jan 2011 05:35:19 +0000 (UTC)
From:      David Xu <davidxu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r216949 - head/lib/libthr/thread
Message-ID:  <201101040535.p045ZJEu023791@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: davidxu
Date: Tue Jan  4 05:35:19 2011
New Revision: 216949
URL: http://svn.freebsd.org/changeset/base/216949

Log:
  Because sleepqueue may still being used, we should always check wchan with
  queue locked.

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

Modified: head/lib/libthr/thread/thr_cond.c
==============================================================================
--- head/lib/libthr/thread/thr_cond.c	Tue Jan  4 02:52:22 2011	(r216948)
+++ head/lib/libthr/thread/thr_cond.c	Tue Jan  4 05:35:19 2011	(r216949)
@@ -246,11 +246,6 @@ cond_wait_user(struct pthread_cond *cvp,
 			error = _thr_sleep(curthread, cvp->__clock_id, abstime);
 		}
 
-		if (curthread->wchan == NULL) {
-			error = 0;
-			goto out;
-		}
-
 		_sleepq_lock(cvp);
 		if (curthread->wchan == NULL) {
 			error = 0;
@@ -274,7 +269,6 @@ cond_wait_user(struct pthread_cond *cvp,
 		}
 	}
 	_sleepq_unlock(cvp);
-out:
 	curthread->mutex_obj = NULL;
 	_mutex_cv_lock(mp, recurse);
 	return (error);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101040535.p045ZJEu023791>