]> git.sur5r.net Git - openldap/commitdiff
Only use tool IDL cache when multithreaded
authorHoward Chu <hyc@openldap.org>
Thu, 20 Oct 2011 20:46:39 +0000 (13:46 -0700)
committerHoward Chu <hyc@openldap.org>
Thu, 20 Oct 2011 20:46:39 +0000 (13:46 -0700)
servers/slapd/back-mdb/index.c

index 58faf40444bccb397dcfd132202e2e2bb25b9b1e..2b71bc1a2a4218099bf936415b160bb599af6e43 100644 (file)
@@ -190,7 +190,7 @@ static int indexer(
 
        if ( opid == SLAP_INDEX_ADD_OP ) {
 #ifdef MDB_TOOL_IDL_CACHING
 
        if ( opid == SLAP_INDEX_ADD_OP ) {
 #ifdef MDB_TOOL_IDL_CACHING
-               if ( slapMode & SLAP_TOOL_QUICK ) {
+               if (( slapMode & SLAP_TOOL_QUICK ) && slap_tool_thread_max > 2 ) {
                        keyfunc = mdb_tool_idl_add;
                        mc = (MDB_cursor *)ai;
                } else
                        keyfunc = mdb_tool_idl_add;
                        mc = (MDB_cursor *)ai;
                } else