svn commit: r200622 - stable/8/lib/libthr/thread

Marcel Moolenaar marcel at FreeBSD.org
Thu Dec 17 02:06:07 UTC 2009


Author: marcel
Date: Thu Dec 17 02:06:07 2009
New Revision: 200622
URL: http://svn.freebsd.org/changeset/base/200622

Log:
  MFC rev 200498:
  Work-around a race condition on ia64 while unlocking a contested lock.

Modified:
  stable/8/lib/libthr/thread/thr_umtx.c
Directory Properties:
  stable/8/lib/libthr/   (props changed)

Modified: stable/8/lib/libthr/thread/thr_umtx.c
==============================================================================
--- stable/8/lib/libthr/thread/thr_umtx.c	Thu Dec 17 00:22:56 2009	(r200621)
+++ stable/8/lib/libthr/thread/thr_umtx.c	Thu Dec 17 02:06:07 2009	(r200622)
@@ -112,10 +112,13 @@ __thr_umutex_timedlock(struct umutex *mt
 int
 __thr_umutex_unlock(struct umutex *mtx, uint32_t id)
 {
+#ifndef __ia64__
+	/* XXX this logic has a race-condition on ia64. */
 	if ((mtx->m_flags & (UMUTEX_PRIO_PROTECT | UMUTEX_PRIO_INHERIT)) == 0) {
 		atomic_cmpset_rel_32(&mtx->m_owner, id | UMUTEX_CONTESTED, UMUTEX_CONTESTED);
 		return _umtx_op_err(mtx, UMTX_OP_MUTEX_WAKE, 0, 0, 0);
 	}
+#endif /* __ia64__ */
 	return _umtx_op_err(mtx, UMTX_OP_MUTEX_UNLOCK, 0, 0, 0);
 }
 


More information about the svn-src-stable mailing list