}
#ifdef LDAP_R_COMPILE
+#define LDAP_DEBUG_R_SASL
void *ldap_pvt_sasl_mutex_new(void)
{
ldap_pvt_thread_mutex_t *mutex;
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 );
}