Posted to tcl by miguel at Fri Jan 11 11:29:09 GMT 2008view raw
- Index: unix/tclUnixThrd.c
- ===================================================================
- RCS file: /cvsroot/tcl/tcl/unix/tclUnixThrd.c,v
- retrieving revision 1.56
- diff -u -r1.56 tclUnixThrd.c
- --- unix/tclUnixThrd.c 11 Jan 2008 10:54:49 -0000 1.56
- +++ unix/tclUnixThrd.c 11 Jan 2008 11:11:58 -0000
- @@ -223,16 +223,12 @@
- #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;
- -
- /*
- * 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 +243,21 @@
- * 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.
- */
- +#ifdef __GLIBC__
- + static int initialized = 0;
- +
- if (!initialized) {
- initialized = 1;
- return 0;
- } else {
- +#else
- + {
- +#endif
- if (pthread_attr_init(&threadAttr) != 0) {
- return -1;
- }