You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2016/03/05 13:08:15 UTC
svn commit: r1733706 - /apr/apr/trunk/locks/unix/proc_mutex.c
Author: ylavic
Date: Sat Mar 5 12:08:15 2016
New Revision: 1733706
URL: http://svn.apache.org/viewvc?rev=1733706&view=rev
Log:
apr_proc_mutex-pthread: follow up to r1733694.
Add missing refcount decrement when recovering the mutex from died owner,
like in proc_mutex_proc_pthread_acquire() but this time for
proc_mutex_proc_pthread_tryacquire() and proc_mutex_proc_pthread_timedacquire().
Modified:
apr/apr/trunk/locks/unix/proc_mutex.c
Modified: apr/apr/trunk/locks/unix/proc_mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/locks/unix/proc_mutex.c?rev=1733706&r1=1733705&r2=1733706&view=diff
==============================================================================
--- apr/apr/trunk/locks/unix/proc_mutex.c (original)
+++ apr/apr/trunk/locks/unix/proc_mutex.c Sat Mar 5 12:08:15 2016
@@ -613,6 +613,7 @@ static apr_status_t proc_mutex_proc_pthr
#ifdef HAVE_PTHREAD_MUTEX_ROBUST
/* Okay, our owner died. Let's try to make it consistent again. */
if (rv == EOWNERDEAD) {
+ apr_atomic_dec32(&proc_pthread_mutex_refcount(mutex));
pthread_mutex_consistent_np(mutex->pthread_interproc);
rv = APR_SUCCESS;
}
@@ -655,6 +656,7 @@ proc_mutex_proc_pthread_timedacquire(apr
#ifdef HAVE_PTHREAD_MUTEX_ROBUST
/* Okay, our owner died. Let's try to make it consistent again. */
if (rv == EOWNERDEAD) {
+ apr_atomic_dec32(&proc_pthread_mutex_refcount(mutex));
pthread_mutex_consistent_np(mutex->pthread_interproc);
rv = APR_SUCCESS;
}