summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixThrd.c
Commit message (Collapse)AuthorAgeFilesLines
* * generic/tclBasic.c:Miguel Sofer2007-11-261-10/+47
| | | | | | | | | * generic/tclInt.h: * unix/tclUnixInit.c: * unix/tclUnixThrd.c: Fix stack checking via workaround for bug in glibc's pthread_attr_get_np, patch from [Bug 1815573]. Many thanks to Sergei Golovan (aka Teo) for detecting the bug and helping diagnose and develop the fix.
* Silence some warnings.dkf2007-11-161-5/+5
|
* * unix/tclUnixThrd.c (Tcl_JoinThread): fix for 64-bit handling ofhobbs2007-05-291-3/+7
| | | | pthread_join exit return code storage. [Bug 1712723]
* supply missing RCS linedgp2006-12-191-1/+1
|
* Fix [Bug 1618838]dkf2006-12-191-2/+5
|
* * unix/tclUnixThrd.c (TclpInetNtoa): fix for 64 bit.das2006-12-191-1/+1
|
* * unix/tclUnixThrd.c (TclpInetNtoa): fix for 64 bit.das2006-12-191-3/+3
|
* * unix/tclUnixThrd.c (TclpInetNtoa): fix for 64 bit.das2006-12-191-7/+3
|
* * generic/tclCompExpr.c: fix gcc warnings about 'cast to/fromdas2006-11-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * generic/tclEncoding.c: pointer from/to integer of different * generic/tclEvent.c: size' on 64-bit platforms by casting to * generic/tclExecute.c: intermediate types intptr_t/uintptr_t * generic/tclHash.c: via new PTR2INT(), INT2PTR(), * generic/tclIO.c: PTR2UINT() and UINT2PTR() macros. * generic/tclInt.h: [Patch 1592791] * generic/tclProc.c: * generic/tclTest.c: * generic/tclThreadStorage.c: * generic/tclTimer.c: * generic/tclUtil.c: * unix/configure.in: * unix/tclUnixChan.c: * unix/tclUnixPipe.c: * unix/tclUnixPort.h: * unix/tclUnixTest.c: * unix/tclUnixThrd.c: * unix/configure: autoconf-2.59 * unix/tclConfig.h.in: autoheader-2.59
* * unix/tclUnixThrd.c (TclpThreadGetStackSize): Darwin: fix for maindas2006-10-161-5/+10
| | | | | | thread, where pthread_get_stacksize_np() returns incorrect info. * macosx/GNUmakefile: don't redo prebinding of non-prebound binaires.
* * unix/tclUnixThrd.c (TclpThreadGetStackSize): on Darwin, usedas2006-10-131-0/+2
| | | | | | * unix/tcl.m4: pthread_get_stacksize_np() API to get thread stack size. * unix/configure: autoconf-2.59 * unix/tclConfig.h.in: autoheader-2.59
* Fix for stack.test failures on FreeBSDJoe Mistachkin2006-08-291-1/+1
|
* ANSIfydkf2005-11-021-55/+55
|
* radical refactoring of thread storage to untangle dependenciesKevin B Kenny2005-08-111-168/+0
|
* Getting more systematic about styledkf2005-07-201-125/+136
|
* Fixed TclpFreeAllocCache() to recognize when being called with NULLvasiljevic2005-04-161-7/+10
| | | | | argument. This is a signal for it to clean up the tsd key associated with the threading allocator.
* Comment typo fixdkf2005-01-111-1/+1
|
* Remove readdir_r() and related #ifdeffery (see #1095909).jenglish2005-01-091-47/+5
| | | | Don't check for HAVE_READDIR_R. Regenerated configure script.
* * unix/configure: Regen.mdejong2004-11-221-1/+5
| | | | | | | | | * unix/tcl.m4 (SC_ENABLE_THREADS): Check for a 2 argument version of readdir_r that is known to exists under IRIX 5.3. * unix/tclUnixThrd.c (TclpReaddir): Use either 2 arg or 3 arg version of readdir_r. [Bug 1001325]
* Changed handling of the returned thread ID since broken on 64-bitvasiljevic2004-08-101-2/+4
| | | | systems (Cray). Thanks to Rob Ratcliff for reporting the bug.
* * generic/tclEvent.c: Correct threaded obj allocator tohobbs2004-07-211-12/+34
| | | | | | | * generic/tclInt.h: fully cleanup on exit and allow for * generic/tclThreadAlloc.c: reinitialization. [Bug #736426] * unix/tclUnixThrd.c: (mistachkin, kenny) * win/tclWinThrd.c:
* * unix/tclUnixThrd.c (TclpFinalizeMutex): Accepted Joeandreas_kupries2004-07-151-0/+1
| | | | | Mistachkin's patch for [Tcl SF Bug 99453], closing leakage of mutexes. They were not destroyed properly upon finalization.
* Version of [Patch 746578] that works with Linux and is likely to work elsewheredkf2004-06-231-0/+49
|
* Integrated fix for Tcl Bug #770053 from core-8-4-branchvasiljevic2004-06-221-2/+2
|
* Made compiling with -Wstrict-prototypes -Wmissing-prototypes much cleaner.dkf2004-05-271-2/+2
| | | | Also added support for [FRQ 951168] but left that switched off by default.
* 2004-05-14 Kevin B. Kenny <kennykb@acm.org> Kevin B Kenny2004-05-141-47/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclInt.decls: Promoted TclpLocaltime and TclpGmtime * generic/tclIntDecls.h: from Unix-specific stubs to the generic * generic/tclIntPlatDecls.h: internal Stubs table. Reran 'genstubs' * generic/tclStubInit.c: * unix/tclUnixPort.h: * generic/tclClock.c: Changed a buggy 'GMT' timezone specification to the correct 'GMT0'. [Bug #922848] * unix/tclUnixThrd.c: Moved TclpGmtime and TclpLocaltime to unix/tclUnixTime.c where they belong. * unix/tclUnixTime.c (TclpGmtime, TclpLocaltime, TclpGetTimeZone, ThreadSafeGMTime [removed], ThreadSafeLocalTime [removed], SetTZIfNecessary, CleanupMemory): Restructured to make sure that the same mutex protects all calls to localtime, gmtime, and tzset. Added a check in front of those calls to make sure that the TZ env var hasn't changed since the last call to tzset, and repeat tzset if necessary. [Bug #942078] Removed a buggy test of the Daylight Saving Time information in 'gettimeofday' in favor of applying 'localtime' to a known value. [Bug #922848] * tests/clock.test (clock-3.14): Added test to make sure that changes to $env(TZ) take effect immediately. * win/tclWinTime.c (TclpLocaltime, TclpGmtime): Added porting layer for 'localtime' and 'gmtime' calls.
* * generic/tclInt.h:davygrvy2004-04-231-0/+30
| | | | | | | | | * generic/tclThread.c: * generic/tclEvent.c: * unix/tclUnixThrd.c: * win/tclWinThrd.c: Provisions made so masterLock, initLock, allocLock and joinLock mutexes can be recovered during Tcl_Finalize.
* Patch 922727 committed. Implements three changes:dgp2004-04-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | * generic/tclInt.h: Reworked the Tcl header files into a clean * unix/tclUnixPort.h: hierarchy where tcl.h < tclPort.h < tclInt.h * win/tclWinInt.h: and every C source file should #include * win/tclWinPort.h: at most one of those files to satisfy its declaration needs. tclWinInt.h and tclWinPort.h also better organized so that tclWinPort.h includes the Windows implementation of cross-platform declarations, while tclWinInt.h makes declarations that are available on Windows only. * generic/tclBinary.c (TCL_NO_MATH): Deleted the generic/tclMath.h * generic/tclMath.h (removed): header file. The internal Tcl * macosx/Makefile (PRIVATE_HEADERS): header, tclInt.h, has a * win/tcl.dsp: #include <math.h> directly, and file external to Tcl needing libm should do the same. * win/Makefile.in (WIN_OBJS): Deleted the win/tclWinMtherr.c file. * win/makefile.bc (TCLOBJS): It's a vestige from matherr() days * win/makefile.vc (TCLOBJS): gone by. * win/tcl.dsp: * win/tclWinMtherr.c (removed):
* All uses of 'panic' (the macro) changeddavygrvy2003-12-241-1/+1
| | | | | | | to 'Tcl_Panic' (the function). The #define of panic in tcl.h clearly states it is deprecated in the comments. [Patch 865264]
* fix for [Bug 732477]Joe Mistachkin2003-05-131-6/+6
|
* Corrected Tcl bug #723502vasiljevic2003-05-121-1/+1
|
* * unix/tclUnixThrd.c (TclpReaddir):hobbs2003-02-201-3/+1
| | | | | | * unix/tclUnixPort.h: update to Bug 689100 patch to ensure that there is a defined value of MAXNAMLEN (aka NAME_MAX in POSIX) and that we have some buffer allocated.
* * unix/tclUnixThrd.c (TclpReaddir): reduce size of name string inhobbs2003-02-191-2/+4
| | | | tsd to NAME_MAX instead of PATH_MAX. [Bug #689100] (waters)
* * generic/tclInt.decls:das2002-08-061-5/+27
| | | | | | | | | | | * unix/tclUnixThrd.c: Added stubs and implementations for non-threaded build for the tclUnixThrd.c procs TclpReaddir, TclpLocaltime, TclpGmtime and TclpInetNtoa. Fixes link errors in stubbed & threaded extensions that include tclUnixPort.h and use any of the procs readdir, localtime, gmtime or inet_ntoa (e.g. TclX 8.4) [Bug 589526] * generic/tclIntPlatDecls.h: * generic/tclStubInit.c: Regen.
* Changed all the Tcl_Platform* symbols to TclOS*; they weren't public so theirdkf2002-06-281-12/+15
| | | | names were really badly chosen. Also prevented a double-#def.
* * unix/tclUnixThrd.c (TclpReaddir, TclpLocaltime, TclpGmtime):das2002-06-061-0/+40
| | | | | | | | | | | | | added mutex wrapped calls to readdir, localtime & gmtime in case their thread-safe *_r counterparts are not available. * unix/tcl.m4: added configure check for readdir_r * unix/tcl.m4 (Darwin): set TCL_DEFAULT_ENCODING to utf-8 on MacOSX (where posix file apis expect utf-8, not iso8859-1). * unix/configure: regen * unix/Makefile.in: set DYLD_LIBRARY_PATH in parallel to LD_LIBRARY_PATH for MacOSX dynamic linker. * generic/tclEnv.c (TclSetEnv): fix env var setting on MacOSX (adapted from patch #524352 by jkbonfield).
* * generic/tclAlloc.c:hobbs2002-04-231-0/+50
| | | | | | | | | | | | | | | * generic/tclInt.h: * generic/tclThreadAlloc.c (new): * unix/Makefile.in: * unix/tclUnixThrd.c: * win/Makefile.in: * win/tclWinInt.h: * win/tclWinThrd.c: added new threaded allocator contributed by AOL that significantly reduces lock contention when multiple threads are in use. Only Windows and Unix implementations are ready, and the Windows one may need work. It is only used by default on Unix for now, and requires that USE_THREAD_ALLOC be defined (--enable-threads on Unix will define this).
* TIP#72 implementation. See ChangeLog for details.dkf2002-02-151-4/+4
| | | | | This version builds clean on Solaris/SPARC, with GCC and CC, both with and without threads and both in 32-bit and 64-bit mode.
* * unix/tclUnixPort.h:hobbs2002-02-081-1/+70
| | | | | * unix/tclUnixThrd.c: added thread-safe versions of readdir, localtime, gmtime and inet_ntoa for threaded build. (jgdavidson)
* added TIP#73 patch #483500 from Kevin Kenny.hobbs2001-11-211-1/+1
| | | | This deprecates TclpGetTime in favor of new Tcl_GetTime.
* * unix/tclUnixThrd.c (Tcl_ConditionWait): fixed handling ofhobbs2001-03-291-2/+11
| | | | | timeout for threads (corrects excessive CPU usage issue for Tk on Unix in threaded Tcl environment). (ruppert) [Bug #411603]
* 2000-05-02 Andreas Kupries <a.kupries@westend.com>kupries2000-05-021-2/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Overall changes: (1) Implementation of joinable threads for all platforms. (2) Additional API's for channels. Required to allow the thread extension to move channels between threads. * generic/tcl.decls (lines 1360f): Added Tcl_JoinThread, Tcl_IsChannelShared, Tcl_IsChannelRegistered, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting and Tcl_ClearChannelHandlers (slots 394 to 400). * generic/tclIO.c: Implemented Tcl_IsChannelRegistered, Tcl_IsChannelShared, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting and Tcl_ClearChannelHandlers. Tcl_CutChannel uses code from CloseChannel. Replaced this code by a call to Tcl_CutChannel. Replaced several code fragments adding channels to the channel list with calls to Tcl_SpliceChannel. Removed now unused variables from CloseChannel and Tcl_UnstackChannel. Tcl_ClearChannelHandlers uses code from Tcl_Close. Replaced this code by a call to Tcl_ClearChannelHandlers. Removed now unused variables from Tcl_Close. Added the subcommands 'cut', 'forgetch', 'splice' and 'isshared' to the test code (TclTestChannelCmd). * unix/tclUnixThread.c: Implemented Tcl_JoinThread using the pthread-functionality. * win/tclWinThrd.c: Fixed several small typos in comments. Implemented Tcl_JoinThread using a platform independent emulation layer (see generic/tclThreadJoin.c below). Added 'joinLock' to serialize Tcl_CreateThread and TclpExitThread to prevent a race for joinable threads. * mac/tclMacThrd.c: Implemented Tcl_JoinThread using a platform independent emulation layer (see generic/tclThreadJoin.c below). Due to the cooperative nature of threading on this platform the race mentioned above is not present. * generic/tclThreadJoin.c: New file. Contains a platform independent emulation layer helping in the implementation of joinable threads for the win and mac platforms. * generic/tclInt.h: Added declarations for TclJoinThread, TclRememberJoinableThread and TclSignalExitThread. These procedures define the API of the emulation layer for joinable threads (see generic/tclThreadJoin.c above). * win/Makefile.in: * win/makefile.vc: Added generic/tclTheadJoin.o to the rules. * mac/: I don't know to which file generic/tclTheadJoin.o has to be added to so that it compiles. Sorry. * unix/tclUnixChan.c: #ifdef'd the thread-local list of file channels as it prevents us from transfering channels. To restore this we may need an extended interface to drivers in the future. Target: 9.0. Found while testing the new transfer of channels. The information in this list for a channel was left behind and then crashed the system during finalization. * generic/tclThreadTest.c: Added -joinable flag to 'testthread create'. Added subcommand 'testthread join'. * doc/CrtChannel.3: Added documentation for Tcl_IsChannelRegistered, Tcl_IsChannelShared, Tcl_CutChannel, Tcl_SpliceChannel, Tcl_IsChannelExisting and Tcl_ClearChannelHandlers. * doc/Thread.3: Added documentation for Tcl_JoinThread. * tests/thread.test: Added tests for joining of threads.
* * unix/tclUnixThrd.c: removed {}s around PTHREAD_MUTEX_INITIALIZERhobbs2000-04-251-3/+3
| | | | [Bug: 5254]
* * unix/tclUnixNotfy.c (Tcl_FinalizeNotifier, NotifierThreadProc):hobbs2000-04-241-2/+2
| | | | | | | added write of 'q' into triggerPipe for notifier in threaded case, so that Tcl doesn't hang when children are still running [Bug: 4139] * unix/tclUnixThrd.c (Tcl_MutexLock): minor comment fixes.
* Fixed compiler warningswelch2000-04-111-3/+3
|
* * unix/tclUnixThrd.c (Tcl_CreateThread): moved TCL_THREADS ifdefhobbs2000-04-091-1/+5
| | | | | | inside of func as it is declared for non-threads builds as well. In the non-threads case, it always returns TCL_ERROR (couldn't create thread).
* 2000-04-08 Andreas Kupries <a.kupries@westend.com>kupries2000-04-091-19/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Overall change: Definition of a public API for the creation of new threads. * generic/tclInt.h (line 1802f): Removed the definition of 'TclpThreadCreate'. (line 793f) Removed the definition of 'Tcl_ThreadCreateProc'. * generic/tcl.h (line 388f): Readded the definition of 'Tcl_ThreadCreateProc'. Added Win32 stuff send in by David Graveraux <davygrvy@bigfoot.com> to that too (__stdcall, ...). Added macros for the default stacksize and allowed flags. * generic/tcl.decls (line 1356f): Added definition of 'Tcl_CreateThread', slot 393 of the stub table. Two new arguments in the public API, for stacksize and flags. * win/tclWinThrd.c: * mac/tclMacThrd.c: Renamed TclpThreadCreate to Tcl_CreateThread, added handling of the stacksize. Flags are currently ignored. * unix/tclUnixThrd.c: See above, but handles joinable flag. Ignores the specified stacksize if the macro HAVE_PTHREAD_ATTR_SETSTACKSIZE is not defined. * generic/tclThreadTest.c (line 363): See below. * unix/tclUnixNotfy.c (line 210): Adapted to the changes above. Uses default stacksize and no flags now. * unic/tcl.m4 (line 382f): Added a check for 'pthread_attr_setstacksize' to detect platforms not implementing this feature of pthreads. If it is implemented, configure will define the macro HAVE_PTHREAD_ATTR_SETSTACKSIZE (See unix/tclUnixThrd.c too). * doc/Thread.3: Added Tcl_CreateThread and its arguments to the list of described functions. Removed stuff about not providing a public C-API for thread-creation.
* * tests/unixFCmd.test:hobbs2000-01-121-0/+22
| | | | | | | | | | | | | | | | | | * 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]
* Fixed level of indirection in Tcl_GetAllocMutexwelch1999-08-101-1/+2
|
* Added Tcl_GetAllocMutex for use by tclAlloc.c and tclCkalloc.cwelch1999-08-101-25/+24
|