Diff for /include/ldap_int_thread.h between versions 1.25 and 1.36

version 1.25, 2007/01/10 23:55:26 version 1.36, 2011/03/14 15:54:30
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.24 2007/01/10 00:29:16 hyc Exp $ */  /* $OpenLDAP: pkg/ldap/include/ldap_int_thread.h,v 1.35 2011/01/04 23:42:57 kurt 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-2007 The OpenLDAP Foundation.   * Copyright 1998-2011 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 44  LDAP_BEGIN_DECL Line 44  LDAP_BEGIN_DECL
 typedef pthread_t               ldap_int_thread_t;  typedef pthread_t               ldap_int_thread_t;
 typedef pthread_mutex_t         ldap_int_thread_mutex_t;  typedef pthread_mutex_t         ldap_int_thread_mutex_t;
 typedef pthread_cond_t          ldap_int_thread_cond_t;  typedef pthread_cond_t          ldap_int_thread_cond_t;
   typedef pthread_key_t           ldap_int_thread_key_t;
   
 #define ldap_int_thread_equal(a, b)     pthread_equal((a), (b))  #define ldap_int_thread_equal(a, b)     pthread_equal((a), (b))
   
Line 68  typedef pthread_cond_t  ldap_int_thread_ Line 69  typedef pthread_cond_t  ldap_int_thread_
 typedef pthread_rwlock_t ldap_int_thread_rdwr_t;  typedef pthread_rwlock_t ldap_int_thread_rdwr_t;
 #endif  #endif
   
   #ifndef LDAP_INT_MUTEX_NULL
   #define LDAP_INT_MUTEX_NULL     PTHREAD_MUTEX_INITIALIZER
   #define LDAP_INT_MUTEX_FIRSTCREATE(m)   ((void) 0)
   #endif
   
 LDAP_END_DECL  LDAP_END_DECL
   
 #elif defined ( HAVE_MACH_CTHREADS )  #elif defined ( HAVE_MACH_CTHREADS )
Line 79  LDAP_END_DECL Line 85  LDAP_END_DECL
   
 #if defined( HAVE_MACH_CTHREADS_H )  #if defined( HAVE_MACH_CTHREADS_H )
 #       include <mach/cthreads.h>  #       include <mach/cthreads.h>
 #elif defined( HAVE_CTHREAD_H  #elif defined( HAVE_CTHREADS_H )
 #       include <cthreads.h>  #       include <cthreads.h>
 #endif  #endif
   
Line 88  LDAP_BEGIN_DECL Line 94  LDAP_BEGIN_DECL
 typedef cthread_t               ldap_int_thread_t;  typedef cthread_t               ldap_int_thread_t;
 typedef struct mutex            ldap_int_thread_mutex_t;  typedef struct mutex            ldap_int_thread_mutex_t;
 typedef struct condition        ldap_int_thread_cond_t;  typedef struct condition        ldap_int_thread_cond_t;
   typedef cthread_key_t           ldap_int_thread_key_t;
   
   #ifndef LDAP_INT_MUTEX_NULL
   #define LDAP_INT_MUTEX_NULL     MUTEX_INITIALIZER
   #define LDAP_INT_MUTEX_FIRSTCREATE(m)   ((void) 0)
   #endif
   
 LDAP_END_DECL  LDAP_END_DECL
   
Line 106  LDAP_BEGIN_DECL Line 118  LDAP_BEGIN_DECL
 typedef pth_t           ldap_int_thread_t;  typedef pth_t           ldap_int_thread_t;
 typedef pth_mutex_t     ldap_int_thread_mutex_t;  typedef pth_mutex_t     ldap_int_thread_mutex_t;
 typedef pth_cond_t      ldap_int_thread_cond_t;  typedef pth_cond_t      ldap_int_thread_cond_t;
   typedef pth_key_t       ldap_int_thread_key_t;
   
 #if 0  #if 0
 #define LDAP_THREAD_HAVE_RDWR 1  #define LDAP_THREAD_HAVE_RDWR 1
 typedef pth_rwlock_t ldap_int_thread_rdwr_t;  typedef pth_rwlock_t ldap_int_thread_rdwr_t;
 #endif  #endif
   
   #ifndef LDAP_INT_MUTEX_NULL
   #define LDAP_INT_MUTEX_NULL     PTH_MUTEX_INIT
   #define LDAP_INT_MUTEX_FIRSTCREATE(m)   ((void) 0)
   #endif
   
 LDAP_END_DECL  LDAP_END_DECL
   
 #elif defined( HAVE_THR )  #elif defined( HAVE_THR )
Line 129  LDAP_BEGIN_DECL Line 147  LDAP_BEGIN_DECL
 typedef thread_t                ldap_int_thread_t;  typedef thread_t                ldap_int_thread_t;
 typedef mutex_t                 ldap_int_thread_mutex_t;  typedef mutex_t                 ldap_int_thread_mutex_t;
 typedef cond_t                  ldap_int_thread_cond_t;  typedef cond_t                  ldap_int_thread_cond_t;
   typedef thread_key_t    ldap_int_thread_key_t;
   
 #define HAVE_REENTRANT_FUNCTIONS 1  #define HAVE_REENTRANT_FUNCTIONS 1
   
Line 139  typedef cond_t   ldap_int_thread_cond_t; Line 158  typedef cond_t   ldap_int_thread_cond_t;
 #define LDAP_THREAD_HAVE_SETCONCURRENCY 1  #define LDAP_THREAD_HAVE_SETCONCURRENCY 1
 #endif  #endif
   
 LDAP_END_DECL  #ifndef LDAP_INT_MUTEX_NULL
   #define LDAP_INT_MUTEX_NULL     DEFAULTMUTEX
 #elif defined( HAVE_LWP )  #define LDAP_INT_MUTEX_FIRSTCREATE(m)   ((void) 0)
 /*************************************  #endif
  *                                   *  
  * thread definitions for SunOS LWP  *  
  *                                   *  
  *************************************/  
   
 #include <lwp/lwp.h>  
 #include <lwp/stackdep.h>  
 #define LDAP_THREAD_HAVE_SLEEP 1  
   
 LDAP_BEGIN_DECL  
   
 typedef thread_t                ldap_int_thread_t;  
 typedef mon_t                   ldap_int_thread_mutex_t;  
 struct ldap_int_thread_lwp_cv {  
         int             lcv_created;  
         cv_t            lcv_cv;  
 };  
 typedef struct ldap_int_thread_lwp_cv ldap_int_thread_cond_t;  
   
 #define HAVE_REENTRANT_FUNCTIONS 1  
   
 LDAP_END_DECL  
   
 #elif defined(HAVE_NT_THREADS)  #elif defined(HAVE_NT_THREADS)
 /*************************************  /*************************************
Line 181  LDAP_BEGIN_DECL Line 178  LDAP_BEGIN_DECL
 typedef unsigned long   ldap_int_thread_t;  typedef unsigned long   ldap_int_thread_t;
 typedef HANDLE  ldap_int_thread_mutex_t;  typedef HANDLE  ldap_int_thread_mutex_t;
 typedef HANDLE  ldap_int_thread_cond_t;  typedef HANDLE  ldap_int_thread_cond_t;
   typedef DWORD   ldap_int_thread_key_t;
   
   #ifndef LDAP_INT_MUTEX_NULL
   #define LDAP_INT_MUTEX_NULL             ((HANDLE)0)
   #define LDAP_INT_MUTEX_FIRSTCREATE(m) \
                   ((void) ((m) || ldap_pvt_thread_mutex_init(&(m))))
   #endif
   
 LDAP_END_DECL  LDAP_END_DECL
   
Line 201  LDAP_BEGIN_DECL Line 205  LDAP_BEGIN_DECL
 typedef int                     ldap_int_thread_t;  typedef int                     ldap_int_thread_t;
 typedef int                     ldap_int_thread_mutex_t;  typedef int                     ldap_int_thread_mutex_t;
 typedef int                     ldap_int_thread_cond_t;  typedef int                     ldap_int_thread_cond_t;
   typedef int                     ldap_int_thread_key_t;
   
 #define LDAP_THREAD_HAVE_TPOOL 1  #define LDAP_THREAD_HAVE_TPOOL 1
 typedef int                     ldap_int_thread_pool_t;  typedef int                     ldap_int_thread_pool_t;
   
   #ifndef LDAP_INT_MUTEX_NULL
   #define LDAP_INT_MUTEX_NULL                             0
   #define LDAP_INT_MUTEX_FIRSTCREATE(m)   ((void) 0)
   #endif
   
 LDAP_END_DECL  LDAP_END_DECL
   
 #endif /* no threads support */  #endif /* no threads support */
Line 275  typedef struct { Line 285  typedef struct {
         ldap_int_thread_t       owner;          ldap_int_thread_t       owner;
 } ldap_debug_thread_mutex_t;  } ldap_debug_thread_mutex_t;
   
   #define LDAP_DEBUG_MUTEX_NULL   {LDAP_INT_MUTEX_NULL, {0,0,{0},0} /*,owner*/}
   #define LDAP_DEBUG_MUTEX_FIRSTCREATE(m) \
           ((void) ((m).usage.state || ldap_pvt_thread_mutex_init(&(m))))
   
 typedef struct {  typedef struct {
         ldap_int_thread_cond_t  wrapped;          ldap_int_thread_cond_t  wrapped;
         ldap_debug_usage_info_t usage;          ldap_debug_usage_info_t usage;

Removed from v.1.25  
changed lines
  Added in v.1.36


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org