mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-02-14 08:13:10 -05:00
Use thread pool for operation threads.
This commit is contained in:
parent
33f4955c07
commit
7ec6a4363f
4 changed files with 6 additions and 2 deletions
|
|
@ -1138,8 +1138,7 @@ static int connection_op_activate( Connection *conn, Operation *op )
|
|||
active_threads++;
|
||||
ldap_pvt_thread_mutex_unlock( &active_threads_mutex );
|
||||
|
||||
status = ldap_pvt_thread_create( &arg->co_op->o_tid, 1,
|
||||
connection_operation, (void *) arg );
|
||||
status = ldap_pvt_thread_pool_submit( connection_pool, connection_operation, (void *) arg );
|
||||
|
||||
if ( status != 0 ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
|
|
|
|||
|
|
@ -1162,6 +1162,8 @@ slapd_daemon_task(
|
|||
}
|
||||
}
|
||||
|
||||
ldap_pvt_thread_pool_destroy(connection_pool, 1);
|
||||
|
||||
ldap_pvt_thread_mutex_lock( &active_threads_mutex );
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"slapd shutdown: waiting for %d threads to terminate\n",
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ char **g_argv;
|
|||
int active_threads;
|
||||
ldap_pvt_thread_mutex_t active_threads_mutex;
|
||||
ldap_pvt_thread_cond_t active_threads_cond;
|
||||
ldap_pvt_thread_pool_t connection_pool;
|
||||
|
||||
ldap_pvt_thread_mutex_t gmtime_mutex;
|
||||
#ifdef SLAPD_CRYPT
|
||||
|
|
@ -96,6 +97,7 @@ slap_init( int mode, const char *name )
|
|||
slap_name = name;
|
||||
|
||||
(void) ldap_pvt_thread_initialize();
|
||||
ldap_pvt_thread_pool_initialize(&connection_pool, 0, 0);
|
||||
|
||||
ldap_pvt_thread_mutex_init( &active_threads_mutex );
|
||||
ldap_pvt_thread_cond_init( &active_threads_cond );
|
||||
|
|
|
|||
|
|
@ -759,6 +759,7 @@ LIBSLAPD_F (time_t) slap_get_time LDAP_P((void));
|
|||
|
||||
LIBSLAPD_F (ldap_pvt_thread_mutex_t) active_threads_mutex;
|
||||
LIBSLAPD_F (ldap_pvt_thread_cond_t) active_threads_cond;
|
||||
LIBSLAPD_F (ldap_pvt_thread_pool_t) connection_pool;
|
||||
|
||||
LIBSLAPD_F (ldap_pvt_thread_mutex_t) entry2str_mutex;
|
||||
LIBSLAPD_F (ldap_pvt_thread_mutex_t) replog_mutex;
|
||||
|
|
|
|||
Loading…
Reference in a new issue