]> git.sur5r.net Git - openldap/commitdiff
Import impoved thread set stack size support
authorKurt Zeilenga <kurt@openldap.org>
Wed, 4 May 2005 00:40:37 +0000 (00:40 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 4 May 2005 00:40:37 +0000 (00:40 +0000)
CHANGES
include/ldap_pvt_thread.h
libraries/libldap_r/thr_posix.c

diff --git a/CHANGES b/CHANGES
index 406bbbb602c31d86c15045aa6afe7a6b1d34d136..9ff1dde11a66004face2824dfa1b1ad52641d5e0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,8 @@ OpenLDAP 2.2 Change Log
 
 OpenLDAP 2.2.27 Engineering
        Fixed ACL val default style parsing crasher (ITS#3700)
+       Build Environment
+               Improved thread set stack size support
 
 OpenLDAP 2.2.26 Release
        Fixed back-bdb ldapadd ctxcsn crash (ITS#3685)
index a10bbd4c1b9945a92bbc162ab65472ddb6a285dd..af13168e14d13b311b7e347143927cc5bbae5a21 100644 (file)
@@ -44,9 +44,13 @@ ldap_pvt_thread_set_concurrency LDAP_P(( int ));
 #define LDAP_PVT_THREAD_CREATE_JOINABLE 0
 #define LDAP_PVT_THREAD_CREATE_DETACHED 1
 
+#define LDAP_PVT_THREAD_SET_STACK_SIZE
 #ifndef LDAP_PVT_THREAD_STACK_SIZE
-       /* LARGE stack */
-#define LDAP_PVT_THREAD_STACK_SIZE     (4*1024*1024)
+       /* LARGE stack. Will be twice as large on 64 bit machine. */
+#define LDAP_PVT_THREAD_STACK_SIZE  ( 1 * 1024 * 1024 * sizeof(void *) )
+/* May be explicitly defined to zero to disable it */
+#elif LDAP_PVT_THREAD_STACK_SIZE == 0
+#undef LDAP_PVT_THREAD_SET_STACK_SIZE
 #endif
 
 LDAP_F( int )
index 176cd55215349e34ffaa0c1903748dc1c7e6f3a4..0d353206fafca11a6cd67ebbad8ba16288c1d20a 100644 (file)
@@ -110,7 +110,7 @@ ldap_pvt_thread_create( ldap_pvt_thread_t * thread,
        pthread_attr_create(&attr);
 #endif
 
-#if defined(LDAP_PVT_THREAD_STACK_SIZE) && LDAP_PVT_THREAD_STACK_SIZE > 0
+#ifdef LDAP_PVT_THREAD_SET_STACK_SIZE
        /* this should be tunable */
        pthread_attr_setstacksize( &attr, LDAP_PVT_THREAD_STACK_SIZE );
 #endif