mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-03-07 14:18:15 +08:00
allow different solutions to debug sasl shutdown
This commit is contained in:
parent
c2efb8788b
commit
864f05497e
@ -1093,6 +1093,7 @@ ldap_int_sasl_set_option( LDAP *ld, int option, void *arg )
|
||||
}
|
||||
|
||||
#ifdef LDAP_R_COMPILE
|
||||
#define LDAP_DEBUG_R_SASL
|
||||
void *ldap_pvt_sasl_mutex_new(void)
|
||||
{
|
||||
ldap_pvt_thread_mutex_t *mutex;
|
||||
@ -1103,27 +1104,47 @@ void *ldap_pvt_sasl_mutex_new(void)
|
||||
if ( ldap_pvt_thread_mutex_init( mutex ) == 0 ) {
|
||||
return mutex;
|
||||
}
|
||||
#ifndef LDAP_DEBUG_R_SASL
|
||||
assert( 0 );
|
||||
#endif /* !LDAP_DEBUG_R_SASL */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int ldap_pvt_sasl_mutex_lock(void *mutex)
|
||||
{
|
||||
#ifdef LDAP_DEBUG_R_SASL
|
||||
if ( mutex == NULL ) {
|
||||
return SASL_OK;
|
||||
}
|
||||
#else /* !LDAP_DEBUG_R_SASL */
|
||||
assert( mutex );
|
||||
#endif /* !LDAP_DEBUG_R_SASL */
|
||||
return ldap_pvt_thread_mutex_lock( (ldap_pvt_thread_mutex_t *)mutex )
|
||||
? SASL_FAIL : SASL_OK;
|
||||
}
|
||||
|
||||
int ldap_pvt_sasl_mutex_unlock(void *mutex)
|
||||
{
|
||||
#ifdef LDAP_DEBUG_R_SASL
|
||||
if ( mutex == NULL ) {
|
||||
return SASL_OK;
|
||||
}
|
||||
#else /* !LDAP_DEBUG_R_SASL */
|
||||
assert( mutex );
|
||||
#endif /* !LDAP_DEBUG_R_SASL */
|
||||
return ldap_pvt_thread_mutex_unlock( (ldap_pvt_thread_mutex_t *)mutex )
|
||||
? SASL_FAIL : SASL_OK;
|
||||
}
|
||||
|
||||
void ldap_pvt_sasl_mutex_dispose(void *mutex)
|
||||
{
|
||||
#ifdef LDAP_DEBUG_R_SASL
|
||||
if ( mutex == NULL ) {
|
||||
return;
|
||||
}
|
||||
#else /* !LDAP_DEBUG_R_SASL */
|
||||
assert( mutex );
|
||||
#endif /* !LDAP_DEBUG_R_SASL */
|
||||
(void) ldap_pvt_thread_mutex_destroy( (ldap_pvt_thread_mutex_t *)mutex );
|
||||
LDAP_FREE( mutex );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user