]> git.sur5r.net Git - openldap/commitdiff
Import root_mutex release change from devel.
authorKurt Zeilenga <kurt@openldap.org>
Fri, 22 Jan 1999 00:02:21 +0000 (00:02 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 22 Jan 1999 00:02:21 +0000 (00:02 +0000)
servers/slapd/back-ldbm/add.c
servers/slapd/back-ldbm/delete.c
servers/slapd/back-ldbm/modify.c
servers/slapd/back-ldbm/modrdn.c

index 26dfd66154166f9b2184f7b965a9f242805a5111..fbf31f43b46f890dcacd212ae13c06cdb4c653f1 100644 (file)
@@ -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);
        }
index 699e57ca96c14e285d10ef69b9355e319cc10c11..79f405a7b5422e0075fef66bf9f85cc9fee732ec 100644 (file)
@@ -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);
        }
index 98ea6b76ed66a591d0f549a53087346de1160398..96e3f9422aa910fc3a1ac41de69dd7705f36f38e 100644 (file)
@@ -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;
index 83c67468c46465fab99eb7e5b65d5db30640983b..33f6536bdc7b01be884e021d8e92fcfb396d56ee 100644 (file)
@@ -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);
        }