summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2008-01-11 11:53:00 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2008-01-11 11:53:00 (GMT)
commitb98ee2e66d8f576ab0efe7986faf70a0aada8836 (patch)
tree3a5f8f3d6741e8caaa4b40bb9c65209ba5610374 /unix
parent289b2781681f8116ff2540bdffc717fc78f39fae (diff)
downloadtcl-b98ee2e66d8f576ab0efe7986faf70a0aada8836.zip
tcl-b98ee2e66d8f576ab0efe7986faf70a0aada8836.tar.gz
tcl-b98ee2e66d8f576ab0efe7986faf70a0aada8836.tar.bz2
* unix/tclUnixThrd.c (TclpThreadGetStackSize): restore stack
checking functionality in freebsd [Bug 1850424]
Diffstat (limited to 'unix')
-rw-r--r--unix/tclUnixThrd.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index dfed046..0cb4b5d 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclUnixThrd.c,v 1.56 2008/01/11 10:54:49 msofer Exp $
+ * RCS: @(#) $Id: tclUnixThrd.c,v 1.57 2008/01/11 11:53:02 msofer Exp $
*/
#include "tclInt.h"
@@ -223,16 +223,13 @@ TclpThreadGetStackSize(void)
#if defined(HAVE_PTHREAD_ATTR_SETSTACKSIZE) && defined(TclpPthreadGetAttrs)
pthread_attr_t threadAttr; /* This will hold the thread attributes for
* the current thread. */
- static int initialized = 0;
-
+#ifdef __GLIBC__
/*
* Fix for [Bug 1815573]
*
* DESCRIPTION:
* On linux TclpPthreadGetAttrs (which is pthread_attr_get_np) may return
- * bogus values on the initial thread. We have a choice: either use the
- * default thread stack (first branch in the #if below), or return 0 and
- * let getrlimit do its thing.
+ * bogus values on the initial thread.
*
* ASSUMPTIONS:
* There seems to be no api to determine if we are on the initial
@@ -247,14 +244,20 @@ TclpThreadGetStackSize(void)
* second Tcl interp will be created only after the first call to
* Tcl_CreateInterp returns.
*
- * These assumptions are satisfied by tclsh. Embedders may want to check
- * their validity, and possibly adapt the code on failing to meet them.
+ * These assumptions are satisfied by tclsh. Embedders on linux may want
+ * to check their validity, and possibly adapt the code on failing to meet
+ * them.
*/
+ static int initialized = 0;
+
if (!initialized) {
initialized = 1;
return 0;
} else {
+#else
+ {
+#endif
if (pthread_attr_init(&threadAttr) != 0) {
return -1;
}