You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2014/05/06 16:42:30 UTC
svn commit: r1592763 - /subversion/trunk/subversion/libsvn_subr/mutex.c
Author: stefan2
Date: Tue May 6 14:42:29 2014
New Revision: 1592763
URL: http://svn.apache.org/r1592763
Log:
Follow-up to r1592640: In non-threaded mode, an erroneous attempt
on recursive locking shall not leave the mutex in an invalid state.
* subversion/libsvn_subr/mutex.c
(svn_mutex__lock): If the lock "failed", don't update the lock count.
Modified:
subversion/trunk/subversion/libsvn_subr/mutex.c
Modified: subversion/trunk/subversion/libsvn_subr/mutex.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/mutex.c?rev=1592763&r1=1592762&r2=1592763&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/mutex.c (original)
+++ subversion/trunk/subversion/libsvn_subr/mutex.c Tue May 6 14:42:29 2014
@@ -148,10 +148,13 @@ svn_mutex__lock(svn_mutex__t *mutex)
if (mutex->checked)
{
/* We want non-threaded systems to detect the same coding errors
- as threaded systems. */
- if (++mutex->count > 1)
+ as threaded systems. No further sync required. */
+ if (mutex->count)
return svn_error_create(SVN_ERR_RECURSIVE_LOCK, NULL,
_("Recursive locks are not supported"));
+
+ /* Update lock counter. */
+ ++mutex->count;
}
#endif
}