Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Mar 2015 09:33:00 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r279586 - stable/10/lib/libthr/thread
Message-ID:  <201503040933.t249X0K3052437@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Wed Mar  4 09:32:59 2015
New Revision: 279586
URL: https://svnweb.freebsd.org/changeset/base/279586

Log:
  MFC r279284:
  Propagate errors from _thr_umutex_unlock2 through mutex_unlock_common.

Modified:
  stable/10/lib/libthr/thread/thr_mutex.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libthr/thread/thr_mutex.c
==============================================================================
--- stable/10/lib/libthr/thread/thr_mutex.c	Wed Mar  4 09:31:10 2015	(r279585)
+++ stable/10/lib/libthr/thread/thr_mutex.c	Wed Mar  4 09:32:59 2015	(r279586)
@@ -633,7 +633,7 @@ mutex_unlock_common(struct pthread_mutex
 {
 	struct pthread *curthread = _get_curthread();
 	uint32_t id;
-	int defered;
+	int defered, error;
 
 	if (__predict_false(m <= THR_MUTEX_DESTROYED)) {
 		if (m == THR_MUTEX_DESTROYED)
@@ -647,6 +647,7 @@ mutex_unlock_common(struct pthread_mutex
 	if (__predict_false(m->m_owner != curthread))
 		return (EPERM);
 
+	error = 0;
 	id = TID(curthread);
 	if (__predict_false(
 		PMUTEX_TYPE(m->m_flags) == PTHREAD_MUTEX_RECURSIVE &&
@@ -660,7 +661,7 @@ mutex_unlock_common(struct pthread_mutex
 			defered = 0;
 
 		DEQUEUE_MUTEX(curthread, m);
-		_thr_umutex_unlock2(&m->m_lock, id, mtx_defer);
+		error = _thr_umutex_unlock2(&m->m_lock, id, mtx_defer);
 
 		if (mtx_defer == NULL && defered)  {
 			_thr_wake_all(curthread->defer_waiters,
@@ -670,7 +671,7 @@ mutex_unlock_common(struct pthread_mutex
 	}
 	if (!cv && m->m_flags & PMUTEX_FLAG_PRIVATE)
 		THR_CRITICAL_LEAVE(curthread);
-	return (0);
+	return (error);
 }
 
 int



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