mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-21 15:19:34 -05:00
ITS#9789 Expose operation_counter_init
This commit is contained in:
parent
70c9dbf93d
commit
ebfbf8281a
2 changed files with 6 additions and 5 deletions
|
|
@ -963,18 +963,18 @@ conn_counter_destroy( void *key, void *data )
|
||||||
ldap_pvt_thread_mutex_unlock( &slap_counters.sc_mutex );
|
ldap_pvt_thread_mutex_unlock( &slap_counters.sc_mutex );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
conn_counter_init( Operation *op, void *ctx )
|
operation_counter_init( Operation *op, void *ctx )
|
||||||
{
|
{
|
||||||
slap_counters_t *sc;
|
slap_counters_t *sc;
|
||||||
void *vsc = NULL;
|
void *vsc = NULL;
|
||||||
|
|
||||||
if ( ldap_pvt_thread_pool_getkey(
|
if ( ldap_pvt_thread_pool_getkey(
|
||||||
ctx, (void *)conn_counter_init, &vsc, NULL ) || !vsc ) {
|
ctx, (void *)operation_counter_init, &vsc, NULL ) || !vsc ) {
|
||||||
vsc = ch_malloc( sizeof( slap_counters_t ));
|
vsc = ch_malloc( sizeof( slap_counters_t ));
|
||||||
sc = vsc;
|
sc = vsc;
|
||||||
slap_counters_init( sc );
|
slap_counters_init( sc );
|
||||||
ldap_pvt_thread_pool_setkey( ctx, (void*)conn_counter_init, vsc,
|
ldap_pvt_thread_pool_setkey( ctx, (void*)operation_counter_init, vsc,
|
||||||
conn_counter_destroy, NULL, NULL );
|
conn_counter_destroy, NULL, NULL );
|
||||||
|
|
||||||
ldap_pvt_thread_mutex_lock( &slap_counters.sc_mutex );
|
ldap_pvt_thread_mutex_lock( &slap_counters.sc_mutex );
|
||||||
|
|
@ -1032,7 +1032,7 @@ connection_operation( void *ctx, void *arg_v )
|
||||||
op->o_qtime.tv_sec--;
|
op->o_qtime.tv_sec--;
|
||||||
}
|
}
|
||||||
op->o_qtime.tv_sec -= op->o_time;
|
op->o_qtime.tv_sec -= op->o_time;
|
||||||
conn_counter_init( op, ctx );
|
operation_counter_init( op, ctx );
|
||||||
ldap_pvt_thread_mutex_lock( &op->o_counters->sc_mutex );
|
ldap_pvt_thread_mutex_lock( &op->o_counters->sc_mutex );
|
||||||
/* FIXME: returns 0 in case of failure */
|
/* FIXME: returns 0 in case of failure */
|
||||||
ldap_pvt_mp_add_ulong(op->o_counters->sc_ops_initiated, 1);
|
ldap_pvt_mp_add_ulong(op->o_counters->sc_ops_initiated, 1);
|
||||||
|
|
|
||||||
|
|
@ -775,6 +775,7 @@ LDAP_SLAPD_F (Connection *) connection_init LDAP_P((
|
||||||
struct berval *id
|
struct berval *id
|
||||||
LDAP_PF_LOCAL_SENDMSG_ARG(struct berval *peerbv)));
|
LDAP_PF_LOCAL_SENDMSG_ARG(struct berval *peerbv)));
|
||||||
|
|
||||||
|
LDAP_SLAPD_F (void) operation_counter_init LDAP_P(( Operation *op, void *threadctx ));
|
||||||
LDAP_SLAPD_F (void) connection_closing LDAP_P((
|
LDAP_SLAPD_F (void) connection_closing LDAP_P((
|
||||||
Connection *c, const char *why ));
|
Connection *c, const char *why ));
|
||||||
LDAP_SLAPD_F (int) connection_is_active LDAP_P(( ber_socket_t s ));
|
LDAP_SLAPD_F (int) connection_is_active LDAP_P(( ber_socket_t s ));
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue