Bugzilla bug #69496: set the minimum thread stack size on OpenVMS. NSPRPUB_CLIENT_BRANCH XPCDOM_20010223_BASE
authorwtc%netscape.com
Thu, 22 Feb 2001 23:30:18 +0000
branchNSPRPUB_CLIENT_BRANCH
changeset 1731 162e78541b533cd0e29716b1e5481d6fbf2044e3
parent 1730 cffa03620c130ba88ea66e2c5a7a655aad01a17d
child 1732 f09901533cf9e12b0d11af89bd5d63e754010a30
child 1734 3494fedc2fb4a4c14a73a13c32e460da0be4f8f4
push idunknown
push userunknown
push dateunknown
bugs69496
Bugzilla bug #69496: set the minimum thread stack size on OpenVMS. r=colin@theblakes.com. Modified files: _openvms.h, ptthread.c (NSPRPUB_CLIENT_BRANCH)
pr/include/md/_openvms.h
pr/src/pthreads/ptthread.c
--- a/pr/include/md/_openvms.h
+++ b/pr/include/md/_openvms.h
@@ -35,16 +35,17 @@
 #else
 #define _PR_SI_ARCHITECTURE "vax"
 #endif
 #define PR_DLL_SUFFIX		".so"
 
 #define _PR_VMBASE		0x30000000
 #define _PR_STACK_VMBASE	0x50000000
 #define _MD_DEFAULT_STACK_SIZE	131072L
+#define _MD_MINIMUM_STACK_SIZE	131072L
 
 /*
 ** This is not defined on OpenVMS. I believe its only used in GC code, and
 ** isn't that only used in Java? Anyway, for now, let's keep the compiler
 ** happy.
 */
 #define SA_RESTART 0
 
--- a/pr/src/pthreads/ptthread.c
+++ b/pr/src/pthreads/ptthread.c
@@ -333,16 +333,19 @@ static PRThread* _PR_CreateThread(
 #if !defined(_PR_DCETHREADS)
     rv = pthread_attr_setdetachstate(&tattr,
         ((PR_JOINABLE_THREAD == state) ?
             PTHREAD_CREATE_JOINABLE : PTHREAD_CREATE_DETACHED));
     PR_ASSERT(0 == rv);
 #endif /* !defined(_PR_DCETHREADS) */
 
     if (0 == stackSize) stackSize = (64 * 1024);  /* default == 64K */
+#ifdef _MD_MINIMUM_STACK_SIZE
+    if (stackSize < _MD_MINIMUM_STACK_SIZE) stackSize = _MD_MINIMUM_STACK_SIZE;
+#endif
     /*
      * Linux doesn't have pthread_attr_setstacksize.
      */
 #ifndef LINUX
     rv = pthread_attr_setstacksize(&tattr, stackSize);
     PR_ASSERT(0 == rv);
 #endif