ITS#9235 Fix librewrite compile without threads

This commit is contained in:
Ryan Tandy 2020-05-16 17:48:22 +00:00
parent c4b6aad6cb
commit 1f39b05f37
2 changed files with 6 additions and 1 deletions

View file

@ -47,9 +47,10 @@
#undef strdup
#define strdup(x) ber_strdup(x)
/* Uncomment to use ldap pvt threads */
#ifndef NO_THREADS
#define USE_REWRITE_LDAP_PVT_THREADS
#include <ldap_pvt_thread.h>
#endif
/*
* For details, see RATIONALE.

View file

@ -185,7 +185,9 @@ rewrite_session_return(
{
assert( session != NULL );
session->ls_count--;
#ifdef USE_REWRITE_LDAP_PVT_THREADS
ldap_pvt_thread_mutex_unlock( &session->ls_mutex );
#endif /* USE_REWRITE_LDAP_PVT_THREADS */
}
/*
@ -329,7 +331,9 @@ rewrite_session_free( void *v_session )
{
struct rewrite_session *session = (struct rewrite_session *)v_session;
#ifdef USE_REWRITE_LDAP_PVT_THREADS
ldap_pvt_thread_mutex_lock( &session->ls_mutex );
#endif /* USE_REWRITE_LDAP_PVT_THREADS */
rewrite_session_clean( v_session );
free( v_session );
}