aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-05-20 19:00:51 +0000
committerCorinna Vinschen <corinna@vinschen.de>2011-05-20 19:00:51 +0000
commit01b49f835da59f2416cc21816a000d054186a268 (patch)
tree7f17bd621c41a6f4c8fa2798db3d2ad893f44302
parentabb205a9fa39a8dfeea78374c230558b9c38553e (diff)
downloadnewlib-01b49f835da59f2416cc21816a000d054186a268.zip
newlib-01b49f835da59f2416cc21816a000d054186a268.tar.gz
newlib-01b49f835da59f2416cc21816a000d054186a268.tar.bz2
* miscfuncs.cc (CygwinCreateThread): Fix condition for adding the
guardsize to the stacksize. Fix accompanying comment.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/miscfuncs.cc8
2 files changed, 8 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 09fe1ea..92c2fea 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2011-05-20 Corinna Vinschen <corinna@vinschen.de>
+ * miscfuncs.cc (CygwinCreateThread): Fix condition for adding the
+ guardsize to the stacksize. Fix accompanying comment.
+
+2011-05-20 Corinna Vinschen <corinna@vinschen.de>
+
* miscfuncs.cc (CygwinCreateThread): Add accidentally missing comment.
2011-05-20 Corinna Vinschen <corinna@vinschen.de>
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc
index 98db1f5..dde06bf 100644
--- a/winsup/cygwin/miscfuncs.cc
+++ b/winsup/cygwin/miscfuncs.cc
@@ -541,11 +541,9 @@ CygwinCreateThread (LPTHREAD_START_ROUTINE thread_func, PVOID thread_arg,
? guardsize : wincap.page_size ();
if (real_guardsize)
real_guardsize = roundup2 (real_guardsize, wincap.page_size ());
- /* If the default stacksize is used and guardsize has not been specified,
- don't add a guard page to the size. Same if stacksize is only
- PTHREAD_STACK_MIN. */
- if (stacksize && guardsize != (ULONG) -1
- && real_stacksize > PTHREAD_STACK_MIN)
+ /* Add the guardsize to the stacksize, but only if the stacksize and
+ the guardsize have been explicitely specified. */
+ if (stacksize || guardsize != (ULONG) -1)
real_stacksize += real_guardsize;
/* Now roundup the result to the next allocation boundary. */
real_stacksize = roundup2 (real_stacksize,