From: Kurt Zeilenga Date: Fri, 22 Jan 1999 00:02:21 +0000 (+0000) Subject: Import root_mutex release change from devel. X-Git-Tag: OPENLDAP_REL_ENG_1_2_BETA~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59c6327ae5a1e2a25158061f4d3e446091539be1;p=thirdparty%2Fopenldap.git Import root_mutex release change from devel. --- diff --git a/servers/slapd/back-ldbm/add.c b/servers/slapd/back-ldbm/add.c index 26dfd66154..fbf31f43b4 100644 --- a/servers/slapd/back-ldbm/add.c +++ b/servers/slapd/back-ldbm/add.c @@ -119,8 +119,8 @@ ldbm_back_add( * and release the add lock. */ pthread_mutex_lock(&li->li_root_mutex); + rootlock = 1; pthread_mutex_unlock(&li->li_add_mutex); - rootlock=1; } /* @@ -134,7 +134,8 @@ ldbm_back_add( if( p != NULL) { /* free parent and writer lock */ cache_return_entry_w( &li->li_cache, p ); - } else if ( rootlock ) { + } + if ( rootlock ) { /* release root lock */ pthread_mutex_unlock(&li->li_root_mutex); } @@ -208,8 +209,9 @@ return_results:; if (p != NULL) { /* free parent and writer lock */ cache_return_entry_w( &li->li_cache, p ); + } - } else if ( rootlock ) { + if ( rootlock ) { /* release root lock */ pthread_mutex_unlock(&li->li_root_mutex); } diff --git a/servers/slapd/back-ldbm/delete.c b/servers/slapd/back-ldbm/delete.c index 699e57ca96..79f405a7b5 100644 --- a/servers/slapd/back-ldbm/delete.c +++ b/servers/slapd/back-ldbm/delete.c @@ -141,8 +141,9 @@ return_results:; if( p != NULL ) { /* free parent and writer lock */ cache_return_entry_w( &li->li_cache, p ); + } - } else if ( rootlock ) { + if ( rootlock ) { /* release root lock */ pthread_mutex_unlock(&li->li_root_mutex); } diff --git a/servers/slapd/back-ldbm/modify.c b/servers/slapd/back-ldbm/modify.c index 98ea6b76ed..96e3f9422a 100644 --- a/servers/slapd/back-ldbm/modify.c +++ b/servers/slapd/back-ldbm/modify.c @@ -32,6 +32,7 @@ ldbm_back_modify( Debug(LDAP_DEBUG_ARGS, "ldbm_back_modify:\n", 0, 0, 0); + /* acquire and lock entry */ if ( (e = dn2entry_w( be, dn, &matched )) == NULL ) { send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT, matched, NULL ); @@ -41,10 +42,6 @@ ldbm_back_modify( return( -1 ); } - /* check for deleted */ - - /* lock entry */ - if ( (err = acl_check_mods( be, conn, op, e, mods )) != LDAP_SUCCESS ) { send_ldap_result( conn, op, err, NULL, NULL ); goto error_return; diff --git a/servers/slapd/back-ldbm/modrdn.c b/servers/slapd/back-ldbm/modrdn.c index 83c67468c4..33f6536bdc 100644 --- a/servers/slapd/back-ldbm/modrdn.c +++ b/servers/slapd/back-ldbm/modrdn.c @@ -176,8 +176,9 @@ return_results: if( p != NULL ) { /* free parent and writer lock */ cache_return_entry_w( &li->li_cache, p ); + } - } else if ( rootlock ) { + if ( rootlock ) { /* release root writer lock */ pthread_mutex_unlock(&li->li_root_mutex); }