summaryrefslogtreecommitdiffstats
path: root/win/tclWinThrd.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix various gcc-4.5.2 64-bit warning messages,nijtmans2011-01-251-2/+2
| | | | e.g. by using full 64-bits for socket fd's
* Simplify Tcl_AppInit and *_Init definitions.nijtmans2010-06-161-2/+2
| | | | | | Change TclpThreadCreate and Tcl_CreateThread signature, making clear that "proc" is a function pointer, as in all other "proc" function parameters.
* Fix TCL_LL_MODIFIER for Cygwinnijtmans2010-01-131-3/+1
| | | | | and various other minor CYGWIN compilation problems
* * win/tclWinDde.c: VC++ 6.0 doesn't havenijtmans2010-01-101-5/+7
| | | | | | | | | | | | | | | | | | | | * win/tclWinReg.c PDWORD_PTR * win/tclWinThrd.c: Fix various minor gcc warnings. * win/tclWinTime.c * win/tclWinConsole.c Put channel type definitions * win/tclWinChan.c in static const memory * win/tclWinPipe.c * win/tclWinSerial.c * win/tclWinSock.c * generic/tclIOGT.c * generic/tclIORChan.c * generic/tclIORTrans.c * unix/tclUnixChan.c * unix/tclUnixPipe.c * unix/tclUnixSock.c * unix/configure (regenerated with autoconf 2.59) * tests/info.test: Make test independant from tcltest implementation.
* Style fixes (unfouling whitespace, sorting comments, removing useless casts, ↵dkf2009-01-091-10/+27
| | | | etc.)
* We need to initialize the thread id variable to 0 as on 64 bit windowspatthoyts2008-10-131-1/+5
| | | | | | this is a pointer sized field while windows only fills it with a 32 bit value. The result is an inability to join the threads as the ids cannot be matched.
* CONSTified 4 functions in the Notifier which all have a Tcl_Time* in it which isnijtmans2008-07-241-5/+5
| | | | | | | | | | | supposed to be a constant, but this was not reflected in the API: Tcl_SetTimer Tcl_WaitForEvent Tcl_ConditionWait Tcl_SetMaxBlockTime Introduced a CONST86, so extensions which have their own Notifier (are there any?) can be modified to compile against both Tcl 8.5 and Tcl 8.6. This change complies with TIP #24
* * win/tclWinThrd.c: Test for TLS_OUT_OF_INDEXES to make certain thatgeorgeps2008-07-161-1/+5
| | | | thread key creation is successful.
* TIP 285 ImplementationJoe Mistachkin2008-06-131-2/+2
|
* * generic/tcl.h: Make Tcl_ThreadDataKey a void *.georgeps2008-05-091-1/+44
| | | | | | | | | | | | | | | | | * generic/tclInt.h: Change around some function names and add some new per-platform declarations for thread-specific data functions. * generic/tclThread.c: Make use of of the new function names that no longer have a Tclp prefix. * generic/tclThreadStorage.c: Replace the core thread-specific data (TSD) mechanism with an array offset solution that eliminates the hash tables, and only uses one slot of native TSD. Many thanks to Kevin B. Kenny for his help with this. * unix/tclUnixThrd.c: Add platform-specific TSD functions for use by tclThreadStorage.c. * win/tclWinThrd.c: Add platform-specific TSD functions for use by tclThreadStorage.c.
* Get rid of pre-C89-isms (esp. CONST vs const).dkf2008-04-271-2/+2
|
* Thread exit handler marks the current thread as un-initialized.vasiljevic2007-03-241-12/+6
| | | | | | This allows exit handlers that are registered later to re-initialize this subsystem in case they need to use some sync primitives (cond variables) from this file again.
* Various minor object file size efficiency fixes. [Bug 1530474]dkf2006-08-101-5/+5
|
* ANSIfydkf2005-11-041-45/+46
|
* radical refactoring of thread storage to untangle dependenciesKevin B Kenny2005-08-111-201/+1
|
* Getting more systematic about styledkf2005-07-241-232/+253
|
* Fixed Tcl Bug #1204064.vasiljevic2005-05-301-9/+9
|
* Merged kennykb-numerics-branch back to the head; TIPs 132 and 232Kevin B Kenny2005-05-101-1/+1
|
* Corrected a compilation error in the --enable-threads configurationKevin B Kenny2005-05-051-8/+13
|
* Renamed TclWinFreeAllocCache to TclpFreeAllocCache and fixed to recognizevasiljevic2005-04-161-20/+23
| | | | | when being called with NULL argument. This is a signal for it to clean up the tsd key associated with the threading allocator.
* * tests/registry.test: Fixed test files to load the correctdavygrvy2004-10-271-2/+3
| | | | | | | | | * tests/winDde.test: registry and dde packages by using the info * win/Makefile.in: from makefiles to tell tcltest where to load * win/makefile.vc: them from. This avoids grabbing the wrong package from $auto_path which might be the install point rather than the dev location. Kudos to Jennifer Hom for adding -load and -loadfile to the tcltest package. [Bug 926088]
* * generic/tclEvent.c: Correct threaded obj allocator tohobbs2004-07-211-7/+28
| | | | | | | * generic/tclInt.h: fully cleanup on exit and allow for * generic/tclThreadAlloc.c: reinitialization. [Bug #736426] * unix/tclUnixThrd.c: (mistachkin, kenny) * win/tclWinThrd.c:
* Redefined MASTER_LOCK in win/tclWinThrd.c to call TclpMasterLock for thevasiljevic2004-07-191-4/+6
| | | | sake of Tcl API users never creating Tcl interpreters.
* Integrated fix for Tcl Bug #770053 from core-8-4-branchvasiljevic2004-06-221-3/+3
|
* A little source clean-up with the allocOnce variable.davygrvy2004-04-271-4/+6
|
* * generic/tclInt.h:davygrvy2004-04-231-5/+36
| | | | | | | | | * 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.
* * win/tclWinThrd.c (Tcl_ConditionNotify): condPtr must be dereferenceddavygrvy2004-01-111-2/+2
| | | | | to see if there are waiters else uninitialized datum is manipulated. [Bug 849007]
* All uses of 'panic' (the macro) changeddavygrvy2003-12-241-13/+13
| | | | | | | 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-7/+7
|
* * win/tclWinThrd.c: Applied SF patch #727271. This patch changesandreas_kupries2003-04-251-9/+54
| | | | | | | | | | the code to catch any errors returned by the windows functions handling TLS ASAP instead of waiting to get some mysterious crash later on due to bogus pointers. Patch provided by Joe Mistachkin. This is a stop-gap measure to deal with the low number of ?TLS slots provided by some of the variants of Windows (60-80).
* Fix mingw build problems and compiler warnings.mdejong2003-01-141-1/+9
| | | | | | | | | | | | | | | | * generic/tcl.h: Add if defined(__MINGW32__) check to code that sets the TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER. * generic/tclClock.c (FormatClock): Don't define savedTimeZone and savedTZEnv if we are not going to use them. * generic/tclEnv.c: Add cast to avoid warning. * win/tclWinChan.c: Use DWORD instead of int to avoid compiler warning. * win/tclWinThrd.c: Only define allocLock, allocLockPtr, and dataKey when TCL_THREADS is defined. This avoid a compiler warning about unused variables.
* * win/tclWinThrd.c (TclpMasterUnlock):hobbs2002-12-101-36/+23
| | | | | * generic/tclThread.c (TclFinalizeThreadData): TclpMasterUnlock must exist and be called unconditional of TCL_THREADS. [Bug #651139]
* * win/tclWinConsole.c:davygrvy2002-11-261-2/+2
| | | | | | | | | | | | | | | | * win/tclWinPipe.c: * win/tclWinSerial.c: * win/tclWinSock.c: * win/tclWinThrd.c: * win/tclWinTime.c: General cleanup of all worker threads used by the channel drivers. Eliminates the normal case where the worker thread is terminated ('cept the winsock one). Instead, use kernel events to signal a clean exit. Only when the worker thread is blocked on an I/O call is the thread terminated. Essentially, this makes all other channel worker threads behave like the PipeReaderThread() function for it's cleaner exit behavior. This appears to fix [Bug 597924] but needs 3rd party confirmation to close the issue.
* * win/tclWinThrd.c (Tcl_CreateThread/TclpThreadExit): Fixeddavygrvy2002-11-191-3/+3
| | | | | | | improper compiler macros that missed the VC++ compiler. This resulted in VC++ builds using CreateThread()/ExitThread() in place of the proper _beginthreadex()/_endthreadex(). This was a large error and am surprised I missed seeing it earlier.
* * win/tclWinThrd.c (TclpFinalizeThreadData, TclWinFreeAllocCache):macosx_8_4_premerge_2002_08_31_trunkmacosx_8_4_merge_2002_08_30_trunkandreas_kupries2002-08-291-10/+7
| | | | | Applied patch for bug #599428, provided by Miguel Sofer <msofer@users.sourceforge.net>.
* * generic/tclAlloc.c:hobbs2002-04-231-2/+76
| | | | | | | | | | | | | | | * 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).
* * win/tclWinThrd.c (TclpThreadExit): Cast status argument tomdejong2001-09-071-2/+2
| | | | | _endthreadex to unsigned instead of DWORD to match the Win32 function prototype.
* * tclWinThrd.c: Revisited _beginthreadex() stuff. Instead of assumingdavygrvy2001-09-051-9/+10
| | | | | a c-runtime implimentation of _beginethreadex normal, I reversed the logic to not assume, and use when is.
* * win/tclWinThrd.c: Moved FinalizeConditionEvent() proto to withindavygrvy2001-09-031-3/+5
| | | | | the main #ifdef TCL_THREADS block to avoid mingw warning about it being there but unused.
* * win/tclWinThrd.c: Portability fix for Cygwin who's c-runtime,davygrvy2001-09-031-1/+15
| | | | | | not surprisingly, doesn't have the MSVCRT specific _beginthreadex / _endthreadex pair. This might have to be revisited for proper Borland, lcc32, Watcom and other support as well.
* * win/tclWinThrd.c (TclpFinalizeMutex, TclpFinalizeCondition):hobbs2001-08-071-1/+3
| | | | added DeleteCriticalSection calls for cleanup [Patch: #419683]
* * win/tclWinThrd.c (Tcl_CreateThread): Close Windowsmdejong2001-07-241-5/+6
| | | | | | HANDLE returned by _beginthreadex. The MS documentation states that this handle is not closed by a later call to _endthreadex.
* * win/tclWinConsole.c:mdejong2001-07-161-2/+1
| | | | | | | | | | * win/tclWinPipe.c: * win/tclWinPort.h: * win/tclWinSerial.c: * win/tclWinThrd.c: Remove unnecessary #includes of dos.h, direct.h, and tchar.h. This will help the Cygwin porting effort since these headers do not exist under Cygwin.
* * win/tclWinDde.c:ericm2000-06-131-2/+2
| | | | | | | | * win/tclWinInit.c: * win/tclWinNotify.c: * win/tclWinPipe.c: * win/tclWinReg.c: * win/tclWinThrd.c: Applied patch from [Bug 5794].
* 2000-05-09 Andreas Kupries <a.kupries@westend.com>kupries2000-05-091-1/+3
| | | | | | | operating as proxy for David Gravereaux <davygrvy@pobox.com> * win/tclWinThrd.c (TclpInitLock, TclpMasterLock): Added missing initialization of joinLock.
* 2000-05-02 Andreas Kupries <a.kupries@westend.com>kupries2000-05-021-4/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * library/dde1.1/pkgIndex.tcl:hobbs2000-04-201-15/+15
| | | | | | | | | | | * library/reg1.0/pkgIndex.tcl: * win/tclWinChan.c: * win/tclWinThrd.c: converted CRLF to LF the */tcl.hpj.in files were not converted, as it confuses hcw locally. [Bug: 5096] * win/Makefile.in: expanded cleanup or help files * doc/Thread.3: minor macro cleanup
* Added Tcl_CreateThreadType and TCL_RETURN_THREAD_TYPEwelch2000-04-171-3/+3
| | | | macros for declaring the NewThread callback proc.
* 2000-04-08 Andreas Kupries <a.kupries@westend.com>kupries2000-04-091-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* * win/mkd.bat:hobbs1999-12-221-5/+5
| | | | | | | | | | * win/rmd.bat: removed necessity of tag.txt [Bug: 3874] * win/tclWinThrd.c: changed CreateThread to _beginthreadex and ExitThread to _endthreadex * win/README.binary: * win/configure.in: updated to patch level 8.3b1