If slapadd'ing a config DB and tool-threads is set in the config LDIF,
the checks for slap_tool_thread_max will be invalid.
return NULL;
}
+static int ldif_threaded;
+
static int
getrec(Erec *erec)
{
int rc;
- if ( slap_tool_thread_max < 2 )
+ if ( !ldif_threaded )
return getrec0(erec);
while (!trec.ready)
ldap_pvt_thread_mutex_init( &add_mutex );
ldap_pvt_thread_cond_init( &add_cond );
ldap_pvt_thread_create( &thr, 0, getrec_thr, NULL );
+ ldif_threaded = 1;
}
erec.nextline = 0;
prev = erec.e;
}
- if ( slap_tool_thread_max > 1 ) {
+ if ( ldif_threaded ) {
ldap_pvt_thread_mutex_lock( &add_mutex );
add_stop = 1;
trec.ready = 0;