Bugzilla bug #69496: set the minimum thread stack size on OpenVMS.
authorwtc%netscape.com
Thu, 22 Feb 2001 23:38:32 +0000
changeset 1733 56e489cfda7f8d6939f2cf2fd5769c911bd7a9d7
parent 1729 01b850433c117e41d88bb610885628d841338ebd
child 1742 47b2e0cd880280791a40e7d68fb4f7f697350af1
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
pr/include/md/_openvms.h
pr/src/pthreads/ptthread.c
--- a/pr/include/md/_openvms.h
+++ b/pr/include/md/_openvms.h
@@ -51,16 +51,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
@@ -349,16 +349,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