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

David Xu davidxu at FreeBSD.org
Tue Apr 17 09:18:07 UTC 2012


Author: davidxu
Date: Tue Apr 17 09:18:06 2012
New Revision: 234373
URL: http://svn.freebsd.org/changeset/base/234373

Log:
  Merge 233103 from head:
  
  Some software think a mutex can be destroyed after it owned it, for
  example, it uses a serialization point like following:
  	pthread_mutex_lock(&mutex);
  	pthread_mutex_unlock(&mutex);
  	pthread_mutex_destroy(&muetx);
  They think a previous lock holder should have already left the mutex and
  is no longer referencing it, so they destroy it. To be maximum compatible
  with such code, we use IA64 version to unlock the mutex in kernel, remove
  the two steps unlocking code.

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	Tue Apr 17 09:09:14 2012	(r234372)
+++ stable/8/lib/libthr/thread/thr_umtx.c	Tue Apr 17 09:18:06 2012	(r234373)
@@ -112,13 +112,6 @@ __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-8 mailing list