diff options
Diffstat (limited to 'unix/tclUnixThrd.c')
-rw-r--r-- | unix/tclUnixThrd.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index 3ac1140..8da1967 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.51.2.3 2007/11/26 19:43:17 dgp Exp $ + * RCS: @(#) $Id: tclUnixThrd.c,v 1.51.2.4 2008/01/23 16:42:25 dgp 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,20 +244,23 @@ 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; -#if 0 - if (pthread_attr_init(&threadAttr) != 0) { - return 0; - } -#else return 0; -#endif } else { +#else + { +#endif + if (pthread_attr_init(&threadAttr) != 0) { + return -1; + } if (TclpPthreadGetAttrs(pthread_self(), &threadAttr) != 0) { pthread_attr_destroy(&threadAttr); return (size_t)-1; |