Rename backend mutex

This commit is contained in:
Ondřej Kuzník 2017-03-17 17:01:36 +00:00 committed by Ondřej Kuzník
parent 3d1ea4693e
commit 2fbc8ca473
4 changed files with 12 additions and 12 deletions

View File

@ -71,9 +71,9 @@ upstream_name_cb( int result, struct evutil_addrinfo *res, void *arg )
}
c = upstream_init( s, b );
ldap_pvt_thread_mutex_lock( &b->b_lock );
ldap_pvt_thread_mutex_lock( &b->b_mutex );
b->b_conns = c;
ldap_pvt_thread_mutex_unlock( &b->b_lock );
ldap_pvt_thread_mutex_unlock( &b->b_mutex );
}
Connection *
@ -84,15 +84,15 @@ backend_select( Operation *op )
LDAP_STAILQ_FOREACH ( b, &backend, b_next ) {
Connection *c;
ldap_pvt_thread_mutex_lock( &b->b_lock );
ldap_pvt_thread_mutex_lock( &b->b_mutex );
c = b->b_conns;
ldap_pvt_thread_mutex_lock( &c->c_mutex );
if ( c->c_state == SLAP_C_READY && !c->c_pendingber ) {
ldap_pvt_thread_mutex_unlock( &b->b_lock );
ldap_pvt_thread_mutex_unlock( &b->b_mutex );
return b->b_conns;
}
ldap_pvt_thread_mutex_unlock( &c->c_mutex );
ldap_pvt_thread_mutex_unlock( &b->b_lock );
ldap_pvt_thread_mutex_unlock( &b->b_mutex );
}
return NULL;

View File

@ -533,7 +533,7 @@ config_backend( ConfigArgs *c )
b->b_host = ch_strdup( lud->lud_host );
}
ldap_pvt_thread_mutex_init( &b->b_lock );
ldap_pvt_thread_mutex_init( &b->b_mutex );
done:
ldap_free_urldesc( lud );

View File

@ -231,7 +231,7 @@ enum lload_tls_type {
struct Backend {
struct slap_bindconf b_bindconf;
ldap_pvt_thread_mutex_t b_lock;
ldap_pvt_thread_mutex_t b_mutex;
int b_proto, b_port;
enum lload_tls_type b_tls;

View File

@ -331,7 +331,7 @@ upstream_bind( void *ctx, void *arg )
ldap_pvt_thread_mutex_unlock( &c->c_mutex );
ldap_pvt_thread_mutex_lock( &b->b_lock );
ldap_pvt_thread_mutex_lock( &b->b_mutex );
if ( b->b_bindconf.sb_method == LDAP_AUTH_SIMPLE ) {
/* simple bind */
rc = ber_printf( ber, "{it{iOtON}}",
@ -355,7 +355,7 @@ upstream_bind( void *ctx, void *arg )
}
#endif /* HAVE_CYRUS_SASL */
}
ldap_pvt_thread_mutex_unlock( &b->b_lock );
ldap_pvt_thread_mutex_unlock( &b->b_mutex );
ldap_pvt_thread_mutex_lock( &c->c_io_mutex );
c->c_pendingber = ber;
@ -417,13 +417,13 @@ upstream_destroy( Connection *c )
c->c_state = SLAP_C_INVALID;
ldap_pvt_thread_mutex_unlock( &c->c_mutex );
ldap_pvt_thread_mutex_lock( &b->b_lock );
ldap_pvt_thread_mutex_lock( &b->b_mutex );
if ( !(b->b_conns == c) ) {
ldap_pvt_thread_mutex_unlock( &b->b_lock );
ldap_pvt_thread_mutex_unlock( &b->b_mutex );
return;
}
b->b_conns = NULL;
ldap_pvt_thread_mutex_unlock( &b->b_lock );
ldap_pvt_thread_mutex_unlock( &b->b_mutex );
ldap_pvt_thread_pool_submit( &connection_pool, backend_connect, b );