diff --git a/servers/slapd/back-bdb/tools.c b/servers/slapd/back-bdb/tools.c index d3701e1593..9dbb549afc 100644 --- a/servers/slapd/back-bdb/tools.c +++ b/servers/slapd/back-bdb/tools.c @@ -93,10 +93,10 @@ int bdb_tool_entry_open( } } - /* Set up for slapindex */ - if ( !(slapMode & SLAP_TOOL_READONLY )) { - int i; - if ( !bdb_tool_info && ( slapMode & SLAP_TOOL_QUICK )) { + /* Set up for threaded slapindex */ + if (( slapMode & (SLAP_TOOL_QUICK|SLAP_TOOL_READONLY)) == SLAP_TOOL_QUICK) { + if ( !bdb_tool_info ) { + int i; ldap_pvt_thread_mutex_init( &bdb_tool_index_mutex ); ldap_pvt_thread_cond_init( &bdb_tool_index_cond ); bdb_tool_index_threads = ch_malloc( slap_tool_thread_max * sizeof( int ));