]> git.sur5r.net Git - openldap/commitdiff
ITS#3494 fix deadlock
authorHoward Chu <hyc@openldap.org>
Wed, 19 Jan 2005 19:18:28 +0000 (19:18 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 19 Jan 2005 19:18:28 +0000 (19:18 +0000)
servers/slapd/back-bdb/cache.c

index f9b452855ba122b8ee79caf3d942d53ab91cf91d..76d6e28c5e056d465694a2a128d24373662829c6 100644 (file)
@@ -919,11 +919,12 @@ bdb_cache_add(
        }
        bdb_cache_entryinfo_unlock( eip );
 
-       /* set lru mutex */
-       ldap_pvt_thread_mutex_lock( &bdb->bi_cache.lru_mutex );
        ++bdb->bi_cache.c_cursize;
        ldap_pvt_thread_rdwr_wunlock( &bdb->bi_cache.c_rwlock );
 
+       /* set lru mutex */
+       ldap_pvt_thread_mutex_lock( &bdb->bi_cache.lru_mutex );
+
        /* lru_mutex is unlocked for us */
        bdb_cache_lru_add( bdb, locker, new );