]> git.sur5r.net Git - openldap/commitdiff
Don't try to use runqueue in SLAP_TOOL_MODE
authorHoward Chu <hyc@openldap.org>
Tue, 6 Apr 2004 12:21:49 +0000 (12:21 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 6 Apr 2004 12:21:49 +0000 (12:21 +0000)
servers/slapd/overlays/pcache.c

index a2679836f00ba47c7d3e8c25e0d7a7b9e05077fa..ff1964b7fcf6736bb253e7d1546583e786ebe6a6 100644 (file)
@@ -1870,10 +1870,13 @@ proxy_cache_open(
                rc = cm->db.bd_info->bi_db_open( &cm->db );
        }
 
-       ldap_pvt_thread_mutex_lock( &syncrepl_rq.rq_mutex );
-       ldap_pvt_runqueue_insert( &syncrepl_rq, cm->cc_period,
-               consistency_check, on );
-       ldap_pvt_thread_mutex_unlock( &syncrepl_rq.rq_mutex );
+       /* There is no runqueue in TOOL mode */
+       if ( slapMode & SLAP_SERVER_MODE ) {
+               ldap_pvt_thread_mutex_lock( &syncrepl_rq.rq_mutex );
+               ldap_pvt_runqueue_insert( &syncrepl_rq, cm->cc_period,
+                       consistency_check, on );
+               ldap_pvt_thread_mutex_unlock( &syncrepl_rq.rq_mutex );
+       }
 
        return rc;
 }