static ldap_pvt_thread_cond_t bdb_tool_trickle_cond;
static void * bdb_tool_trickle_task( void *ctx, void *ptr );
+static int bdb_tool_trickle_active;
#endif
static void * bdb_tool_index_task( void *ctx, void *ptr );
ldap_pvt_thread_mutex_lock( &bdb_tool_trickle_mutex );
ldap_pvt_thread_cond_signal( &bdb_tool_trickle_cond );
ldap_pvt_thread_mutex_unlock( &bdb_tool_trickle_mutex );
+ ldap_pvt_thread_mutex_lock( &bdb_tool_trickle_mutex );
+ while ( bdb_tool_trickle_active )
+ ldap_pvt_thread_cond_wait( &bdb_tool_trickle_cond,
+ &bdb_tool_trickle_mutex );
+ ldap_pvt_thread_mutex_unlock( &bdb_tool_trickle_mutex );
#endif
ldap_pvt_thread_mutex_lock( &bdb_tool_index_mutex );
int wrote;
ldap_pvt_thread_mutex_lock( &bdb_tool_trickle_mutex );
+ bdb_tool_trickle_active = 1;
while ( 1 ) {
ldap_pvt_thread_cond_wait( &bdb_tool_trickle_cond,
&bdb_tool_trickle_mutex );
break;
env->memp_trickle( env, 30, &wrote );
}
+ bdb_tool_trickle_active = 0;
+ ldap_pvt_thread_cond_signal( &bdb_tool_trickle_cond );
ldap_pvt_thread_mutex_unlock( &bdb_tool_trickle_mutex );
return NULL;