version 1.16, 2006/01/03 22:12:06
|
version 1.25, 2007/01/10 23:55:26
|
Line 1
|
Line 1
|
/* ldap_int_thread.h - ldap internal thread wrappers header file */ |
/* ldap_int_thread.h - ldap internal thread wrappers header file */ |
/* $OpenLDAP: pkg/ldap/include/ldap_int_thread.h,v 1.15 2005/09/17 21:28:08 hallvard Exp $ */ |
/* $OpenLDAP: pkg/ldap/include/ldap_int_thread.h,v 1.24 2007/01/10 00:29:16 hyc Exp $ */ |
/* This work is part of OpenLDAP Software <http://www.openldap.org/>. |
/* 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. |
* All rights reserved. |
* |
* |
* Redistribution and use in source and binary forms, with or without |
* Redistribution and use in source and binary forms, with or without |
Line 63 typedef pthread_cond_t ldap_int_thread_
|
Line 63 typedef pthread_cond_t ldap_int_thread_
|
#define LDAP_THREAD_HAVE_SETCONCURRENCY 1 |
#define LDAP_THREAD_HAVE_SETCONCURRENCY 1 |
#endif |
#endif |
|
|
#if 0 && defined( HAVE_PTHREAD_RWLOCK_DESTROY ) |
#if defined( HAVE_PTHREAD_RWLOCK_DESTROY ) |
#define LDAP_THREAD_HAVE_RDWR 1 |
#define LDAP_THREAD_HAVE_RDWR 1 |
typedef pthread_rwlock_t ldap_int_thread_rdwr_t; |
typedef pthread_rwlock_t ldap_int_thread_rdwr_t; |
#endif |
#endif |
Line 227 LDAP_F(int) ldap_int_thread_pool_shutdow
|
Line 227 LDAP_F(int) ldap_int_thread_pool_shutdow
|
typedef struct ldap_int_thread_pool_s * ldap_int_thread_pool_t; |
typedef struct ldap_int_thread_pool_s * ldap_int_thread_pool_t; |
#endif |
#endif |
|
|
|
typedef struct ldap_int_thread_rmutex_s * ldap_int_thread_rmutex_t; |
LDAP_END_DECL |
LDAP_END_DECL |
|
|
|
|
Line 247 LDAP_BEGIN_DECL
|
Line 248 LDAP_BEGIN_DECL
|
#define LDAP_UINTPTR_T unsigned long |
#define LDAP_UINTPTR_T unsigned long |
#endif |
#endif |
|
|
typedef union { |
typedef enum { |
unsigned char *ptr; |
ldap_debug_magic = -(int) (((unsigned)-1)/19) |
LDAP_UINTPTR_T num; |
} 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; |
} ldap_debug_usage_info_t; |
|
|
typedef struct { |
typedef struct { |
ldap_int_thread_mutex_t wrapped; |
ldap_int_thread_mutex_t wrapped; |
ldap_debug_usage_info_t usage; |
ldap_debug_usage_info_t usage; |
|
ldap_int_thread_t owner; |
} ldap_debug_thread_mutex_t; |
} ldap_debug_thread_mutex_t; |
|
|
typedef struct { |
typedef struct { |
Line 267 typedef struct {
|
Line 285 typedef struct {
|
ldap_debug_usage_info_t usage; |
ldap_debug_usage_info_t usage; |
} ldap_debug_thread_rdwr_t; |
} ldap_debug_thread_rdwr_t; |
|
|
|
#ifndef NDEBUG |
|
#define LDAP_INT_THREAD_ASSERT_MUTEX_OWNER(mutex) \ |
|
ldap_debug_thread_assert_mutex_owner( \ |
|
__FILE__, __LINE__, "owns(" #mutex ")", mutex ) |
|
LDAP_F(void) ldap_debug_thread_assert_mutex_owner LDAP_P(( |
|
LDAP_CONST char *file, |
|
int line, |
|
LDAP_CONST char *msg, |
|
ldap_debug_thread_mutex_t *mutex )); |
|
#endif /* NDEBUG */ |
|
|
LDAP_END_DECL |
LDAP_END_DECL |
|
|
#endif /* LDAP_THREAD_DEBUG_WRAP */ |
#endif /* LDAP_THREAD_DEBUG_WRAP */ |