diff options
author | hobbs <hobbs> | 2000-01-12 11:13:54 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2000-01-12 11:13:54 (GMT) |
commit | ada01064f7bee2a0d9103cbf33a62d95fc4f5ea0 (patch) | |
tree | 330a348f974e0dfe1c201adc2b1fe77058474ebc /unix/tclUnixThrd.c | |
parent | f0c936b8a5365ec18f126e2c15715509d64bb440 (diff) | |
download | tcl-ada01064f7bee2a0d9103cbf33a62d95fc4f5ea0.zip tcl-ada01064f7bee2a0d9103cbf33a62d95fc4f5ea0.tar.gz tcl-ada01064f7bee2a0d9103cbf33a62d95fc4f5ea0.tar.bz2 |
* tests/unixFCmd.test:
* unix/tclUnixFCmd.c: added support for symbolic permissions
setting in SetPermissionsAttribute (file attr $file -perm ...)
[Bug: 3970]
* tests/expr.test:
* unix/Makefile.in:
* unix/configure.in:
* unix/tcl.m4: strtod bug on Tru64 [Bug: 3378]
and added tests to prevent unnecessary chmod +x in sources while
installing, as well as more intelligent setsockopt/gethostbyname
checks [Bug: 3366, 3389]
* unix/tclUnixThrd.c: added compile time support (through use of
the TCL_THREAD_STACK_MIN define) for increasing the default stack
size for a thread. [Bug: 3797, 1966]
Diffstat (limited to 'unix/tclUnixThrd.c')
-rw-r--r-- | unix/tclUnixThrd.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index 47e56d7..53489bc 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -81,9 +81,31 @@ TclpThreadCreate(idPtr, proc, clientData) { pthread_attr_t attr; int result; +#ifdef TCL_THREAD_STACK_MIN + size_t size; +#endif pthread_attr_init(&attr); pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); + +#ifdef TCL_THREAD_STACK_MIN + /* + * Certain systems define a thread stack size that by default is + * too small for many operations. The user has the option of + * defining TCL_THREAD_STACK_MIN to a value large enough to work + * for their needs. This would look like (for 128K min stack): + * make MEM_DEBUG_FLAGS=-DTCL_THREAD_STACK_MIN=131072L + * + * This solution is not optimal, as we should allow the user to + * specify a size at runtime, but we don't want to slow this function + * down, and that would still leave the main thread at the default. + */ + result = pthread_attr_getstacksize(&attr, &size); + if (!result && (size < TCL_THREAD_STACK_MIN)) { + pthread_attr_setstacksize(&attr, (size_t) TCL_THREAD_STACK_MIN); + } +#endif + if (pthread_create((pthread_t *)idPtr, &attr, (void * (*)())proc, (void *)clientData) && pthread_create((pthread_t *)idPtr, NULL, |