]> git.sur5r.net Git - openldap/commitdiff
ITS#2470 - mark entry in-use before release cache locks
authorHoward Chu <hyc@openldap.org>
Sat, 10 May 2003 23:58:11 +0000 (23:58 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 10 May 2003 23:58:11 +0000 (23:58 +0000)
servers/slapd/back-bdb/cache.c

index 7bbabf84571a75545cdcc0e7081bfdba481bf8a4..ad5498c29e40aaf00d81c7a22e798af33415b821 100644 (file)
@@ -952,6 +952,9 @@ try_again:
                        goto try_again;
                }
 
+               /* Mark entry in-use */
+               BEI(ep)->bei_refcnt++;
+
                /* free cache read lock */
                ldap_pvt_thread_rdwr_runlock( &cache->c_rwlock );
                /* set lru mutex */
@@ -959,8 +962,6 @@ try_again:
                /* lru */
                LRU_DELETE( cache, ep );
                LRU_ADD( cache, ep );
-               
-               BEI(ep)->bei_refcnt++;
 
                /* free lru mutex */
                ldap_pvt_thread_mutex_unlock( &cache->lru_mutex );