]> git.sur5r.net Git - openldap/blobdiff - include/ldap_int_thread.h
set BINDING appropriately (ITS#5185)
[openldap] / include / ldap_int_thread.h
index 1f2e81dd5856a03f748c70c8bba98b0c92c551e0..d6a6d779575564762c1c324635562ea9acfcb270 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  * 
- * Copyright 1998-2006 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -63,7 +63,7 @@ typedef pthread_cond_t                ldap_int_thread_cond_t;
 #define LDAP_THREAD_HAVE_SETCONCURRENCY 1
 #endif
 
-#if 0 && defined( HAVE_PTHREAD_RWLOCK_DESTROY )
+#if defined( HAVE_PTHREAD_RWLOCK_DESTROY )
 #define LDAP_THREAD_HAVE_RDWR 1
 typedef pthread_rwlock_t ldap_int_thread_rdwr_t;
 #endif
@@ -227,6 +227,7 @@ LDAP_F(int) ldap_int_thread_pool_shutdown ( void );
 typedef struct ldap_int_thread_pool_s * ldap_int_thread_pool_t;
 #endif
 
+typedef struct ldap_int_thread_rmutex_s * ldap_int_thread_rmutex_t;
 LDAP_END_DECL
 
 
@@ -247,9 +248,25 @@ LDAP_BEGIN_DECL
 #define LDAP_UINTPTR_T unsigned long
 #endif
 
-typedef union {
-       unsigned char                   *ptr;
-       LDAP_UINTPTR_T                  num;
+typedef enum {
+       ldap_debug_magic =      -(int) (((unsigned)-1)/19)
+} ldap_debug_magic_t;
+
+typedef enum {
+       /* Could fill in "locked" etc here later */
+       ldap_debug_state_inited = (int) (((unsigned)-1)/11),
+       ldap_debug_state_destroyed
+} ldap_debug_state_t;
+
+typedef struct {
+       /* Enclosed in magic numbers in the hope of catching overwrites */
+       ldap_debug_magic_t      magic;  /* bit pattern to recognize usages  */
+       LDAP_UINTPTR_T          self;   /* ~(LDAP_UINTPTR_T)&(this struct) */
+       union ldap_debug_mem_u {        /* Dummy memory reference */
+               unsigned char   *ptr;
+               LDAP_UINTPTR_T  num;
+       } mem;
+       ldap_debug_state_t      state;  /* doubles as another magic number */
 } ldap_debug_usage_info_t;
 
 typedef struct {