summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtchang%redhat.com <devnull@localhost>2005-03-08 22:07:46 +0000
committerwtchang%redhat.com <devnull@localhost>2005-03-08 22:07:46 +0000
commit2f12c1d288b1395f42c0d73e89d899f3eaf7d904 (patch)
tree61ea23fa1d63da99c4cbe945c62ec8554b588171
parent7db84b2274c7c05e14779fc1a2bc483c0ef95cfc (diff)
downloadnspr-hg-2f12c1d288b1395f42c0d73e89d899f3eaf7d904.tar.gz
Bugzilla bug 274450: a default thread stack size of 64K is too small for
Mozilla on Linux. Use the default pthread stack size instead, and do that on all platforms (not just Linux). r=bzbarsky. Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
-rw-r--r--pr/src/pthreads/ptthread.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/pr/src/pthreads/ptthread.c b/pr/src/pthreads/ptthread.c
index 2b4379e1..35dd13eb 100644
--- a/pr/src/pthreads/ptthread.c
+++ b/pr/src/pthreads/ptthread.c
@@ -356,12 +356,18 @@ static PRThread* _PR_CreateThread(
PR_ASSERT(0 == rv);
#endif /* !defined(_PR_DCETHREADS) */
- if (0 == stackSize) stackSize = (64 * 1024); /* default == 64K */
+ /*
+ * If stackSize is 0, we use the default pthread stack size.
+ */
+ if (stackSize)
+ {
#ifdef _MD_MINIMUM_STACK_SIZE
- if (stackSize < _MD_MINIMUM_STACK_SIZE) stackSize = _MD_MINIMUM_STACK_SIZE;
+ if (stackSize < _MD_MINIMUM_STACK_SIZE)
+ stackSize = _MD_MINIMUM_STACK_SIZE;
#endif
- rv = pthread_attr_setstacksize(&tattr, stackSize);
- PR_ASSERT(0 == rv);
+ rv = pthread_attr_setstacksize(&tattr, stackSize);
+ PR_ASSERT(0 == rv);
+ }
thred = PR_NEWZAP(PRThread);
if (NULL == thred)