summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixThrd.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tclUnixThrd.c')
-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;
}