#define HAVE_SETCONCURRENCY 1
#endif
+#if defined( HAVE_PTHREAD_RWLOCK_DESTROY )
+#define LDAP_THREAD_HAVE_RDWR 1
+typedef pthread_rwlock_t ldap_pvt_thread_rdwr_t;
+#endif
+
LDAP_END_DECL
#elif defined ( HAVE_MACH_CTHREADS )
LIBLDAP_F( int )
ldap_pvt_thread_mutex_unlock LDAP_P(( ldap_pvt_thread_mutex_t *mutex ));
+#ifndef LDAP_THREAD_HAVE_RDWR
typedef struct ldap_pvt_thread_rdwr_var {
ldap_pvt_thread_mutex_t ltrw_mutex;
ldap_pvt_thread_cond_t ltrw_read; /* wait for read */
int ltrw_r_wait;
int ltrw_w_wait;
} ldap_pvt_thread_rdwr_t;
+#endif
LIBLDAP_F( int )
ldap_pvt_thread_rdwr_init LDAP_P((ldap_pvt_thread_rdwr_t *rdwrp));
/* end of preamble */
+#if !defined(SLAPD_SCHEMA_COMPAT) && !defined(SLAPD_SCHEMA_NOT_COMPAT)
+ /* define SLAPD_SCHEMA_COMPAT if you want old schema codes */
+#define SLAPD_SCHEMA_NOT_COMPAT 1
+#endif
+
+
/* Define if on AIX 3.
System headers sometimes define this.
We just want to avoid a redefinition error message. */
/* Define if you have the pthread_kill function. */
#undef HAVE_PTHREAD_KILL
+/* Define if you have the pthread_rwlock_destroy function. */
+#undef HAVE_PTHREAD_RWLOCK_DESTROY
+
/* Define if you have the pthread_setconcurrency function. */
#undef HAVE_PTHREAD_SETCONCURRENCY
# End Source File
# Begin Source File
+SOURCE=.\threads.c
+# End Source File
+# Begin Source File
+
SOURCE=..\libldap\tls.c
# End Source File
# Begin Source File
return 0;
}
-#ifdef LDAP_DEBUG
+#ifdef LDAP_RDWR_DEBUG
/* just for testing,
* return 0 if false, suitable for assert(ldap_pvt_thread_rdwr_Xchk(rdwr))
return pthread_mutex_unlock( mutex );
}
+#ifdef HAVE_PTHREAD_RWLOCK_DESTROY
+int
+ldap_pvt_thread_rdwr_init( ldap_pvt_thread_rdwr_t *rw )
+{
+ return pthread_rwlock_init( rw, NULL );
+}
+
+int
+ldap_pvt_thread_rdwr_destroy( ldap_pvt_thread_rdwr_t *rw )
+{
+ return pthread_rwlock_destroy( rw );
+}
+
+int ldap_pvt_thread_rdwr_rlock( ldap_pvt_thread_rdwr_t *rw )
+{
+ return pthread_rwlock_rdlock( rw );
+}
+
+int ldap_pvt_thread_rdwr_rtrylock( ldap_pvt_thread_rdwr_t *rw )
+{
+ return pthread_rwlock_tryrdlock( rw );
+}
+
+int ldap_pvt_thread_rdwr_runlock( ldap_pvt_thread_rdwr_t *rw )
+{
+ return pthread_rwlock_unlock( rw );
+}
+
+int ldap_pvt_thread_rdwr_wlock( ldap_pvt_thread_rdwr_t *rw )
+{
+ return pthread_rwlock_wrlock( rw );
+}
+
+int ldap_pvt_thread_rdwr_wtrylock( ldap_pvt_thread_rdwr_t *rw )
+{
+ return pthread_rwlock_trywrlock( rw );
+}
+
+int ldap_pvt_thread_rdwr_wunlock( ldap_pvt_thread_rdwr_t *rw )
+{
+ return pthread_rwlock_unlock( rw );
+}
+
+#endif /* LDAP_THREAD_HAVE_RDWR */
#endif /* HAVE_PTHREADS */