summaryrefslogtreecommitdiffstats
path: root/generic/tclEvent.c
Commit message (Collapse)AuthorAgeFilesLines
* More tidying up (whitespace, spelling, useless parentheses, useless casts)dkf2010-02-241-78/+94
|
* Refined the 20090617 patch on [exit] streamlining, so that it now correctly ↵ferrieux2009-07-221-5/+14
| | | | calls thread exit handlers for the calling thread, which includes <Destroy> bindings in Tk [Bug 2001201 again].
* Apply patch from [Bug 988703]. Many thanks to Joe Mistachkin for development.dkf2009-06-181-1/+2
|
* Applied a patch by George Peter Staplin drastically reducing the ambition of ↵ferrieux2009-06-171-33/+65
| | | | [exit] wrt finalization, and thus solving many multi-thread teardown issues [Bugs 2001201, 486399, and possibly 597575, 990457, 1437595, 2750491].
* - eliminate some unnessary type castsnijtmans2009-02-101-2/+2
| | | | | - some internal const decorations - spacing
* Fix [Bug 1028264]: WSACleanup() too early. The fix introduces "late exit ↵ferrieux2009-01-271-2/+102
| | | | handlers" for similar late process-wide cleanups.
* TIP #337 IMPLEMENTATIONdgp2008-12-091-4/+4
| | | | | | | | | | | | | | | | | | | * doc/BackgdErr.3: Converted internal routine * doc/interp.n: TclBackgroundException() into public routine * generic/tcl.decls: Tcl_BackgroundException(). * generic/tclEvent.c: * generic/tclInt.decls: * generic/tclDecls.h: make genstubs * generic/tclIntDecls.h: * generic/tclStubInit.c: * generic/tclIO.c: Update callers. * generic/tclIOCmd.c: * generic/tclInterp.c: * generic/tclTimer.c: *** POTENTIAL INCOMPATIBILITY only for extensions using the converted internal routine ***
* Style improvements - invoking callbacks without visual junk.dkf2008-10-261-6/+5
|
* Add "const" to many internalnijtmans2008-10-161-3/+3
| | | | | const tables. No functional or API change.
* * doc/Exit.3: do not call Tcl_Finalize implicitlyhobbs2008-08-011-3/+4
| | | | | | | * generic/tclEvent.c: on DLL_PROCESS_DETACH as it may lead * win/tclWin32Dll.c (DllMain): to issues and the user should be explicitly calling Tcl_Finalize before unloading regardless. Clarify the docs to note the explicit need in embedded use.
* TIP 285 ImplementationJoe Mistachkin2008-06-131-11/+24
|
* Get rid of pre-C89-isms (esp. CONST vs const).dkf2008-04-271-8/+8
|
* * generic/tclEvent.c (TclDefaultBgErrorHandlerObjCmd): Added errordgp2008-03-101-14/+41
| | | | | * tests/event.test (event-5.*): checking to protect against callers passing invalid return options dictionaries. [Bug 1901113]
* * generic/tclBasic.c (Tcl_AppendObjToErrorInfo): Revised thedgp2008-02-291-2/+1
| | | | | | | | | | refcount management of Tcl_AppendObjToErrorInfo to become that of a conventional Consumer routine. This preserves the ease of use for the overwhelming common callers who pass in a 0-count value, but makes the proper call with a non-0-count value less surprising. * generic/tclEvent.c (TclDefaultBgErrorHandlerObjCmd): Revised the one caller within Tcl itself which passes a non-0-count value to Tcl_AppendObjToErrorInfo().
* merge stable branch onto HEADdgp2007-12-131-1/+1
|
* Generate literal values more efficiently using TclNewLiteralStringObj macro.dkf2007-09-171-2/+5
|
* * generic/tclEvent.c ([::tcl::Bgerror]): Corrections to Tcl'sdgp2007-09-071-13/+27
| | | | | | * tests/event.test: default [interp bgerror] handler so that when it falls back to a hidden [bgerror] in a safe interp, it gets the right error context data. [Bug 1790274].
* * generic/tclResult.c (Tcl_GetReturnOptions): Take care that adgp2007-09-071-26/+20
| | | | | | | | * tests/init.test: non-TCL_ERROR code doesn't cause existing -errorinfo, -errorcode, and -errorline entries to be omitted. * generic/tclEvent.c: With -errorInfo no longer lost, generate more complete ::errorInfo when calling [bgerror] after a non-TCL_ERROR background exception.
* * generic/tclInt.decls: New internal routine TclBackgroundException()dgp2007-09-061-26/+81
| | | | | | | | | | | | | | | | * generic/tclEvent.c: that for the first time permits non-TCL_ERROR exceptions to trigger [interp bgerror] handling. Closes a gap in TIP 221. When falling back to [bgerror] (which is designed only to handle TCL_ERROR), convert exceptions into errors complaining about the exception. * generic/tclInterp.c: Convert Tcl_BackgroundError() callers to call * generic/tclIO.c: TclBackgroundException(). * generic/tclIOCmd.c: * generic/tclTimer.c: * generic/tclIntDecls.h: make genstubs * generic/tclStubInit.c:
* * generic/tclCompExpr.c: Removed dead code, old implementationsdgp2007-07-021-2/+1
| | | | | * generic/tclEvent.c: of expr parsing and compiling, including the * generic/tclInt.h: routine TclFinalizeCompilation().
* Handle creation of Tcl_Objs from constant strings better (easier to use, moredkf2007-04-101-6/+6
| | | | efficient). After [Patch 1529526] (afredd)
* * generic/tclBasic.c (Tcl_CreateMathFunc): Replaced somedgp2007-03-191-3/+3
| | | | | | | * generic/tclEvent.c (Tcl_CreateThread): calls to Tcl_Alloc() * generic/tclObj.c (UpdateStringOfBignum): with calls to * unix/tclUnixTime.c (SetTZIfNecessary): ckalloc(), which better * win/tclAppInit.c (setargv): supports memory debugging.
* * generic/tclEvent.c (HandleBgErrors): Make efficient private copydgp2007-03-121-5/+10
| | | | | | * tests/event.test (event-5.3): of the command prefix for the interp's background error handling command to avoid panics due to pointers to memory invalid after shimmering. [Bug 1670155]
* * generic/tclCompExpr.c: fix gcc warnings about 'cast to/fromdas2006-11-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | * 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
* Fix nasty bug with limits, vwait's (C) traces, and interpreter restart...dkf2006-09-191-4/+6
|
* * generic/tclEvent.c (HandleBgErrors): fix leak. [Coverity issue 86]das2006-05-121-1/+2
|
* Cosmetic touch.vasiljevic2006-03-101-4/+3
|
* ANSIfy. Also converted some deeply nested code to a less nested form for ↵dkf2005-11-011-242/+255
| | | | easier reading.
* fixed bad clock test, removed duplicated code in Tcl_FinalizeKevin B Kenny2005-08-171-19/+1
|
* radical refactoring of thread storage to untangle dependenciesKevin B Kenny2005-08-111-1/+27
|
* further untangling of Tcl_Finalize, and test cleanup on Win32 threadedKevin B Kenny2005-08-101-19/+19
|
* * generic/tclCompExpr.c: Untangled some dependencies in thedgp2005-08-031-11/+26
| | | | | | * generic/tclEvent.c: order of finalization routines. * generic/tclInt.h: [Bug 1251399] * generic/tclObj.c:
* Getting more systematic about styledkf2005-07-171-219/+220
|
* cleanup Tcl_Preserve after exit handlersKevin B Kenny2005-06-241-1/+2
|
* bug 1225727Kevin B Kenny2005-06-221-2/+16
|
* Merged kennykb-numerics-branch back to the head; TIPs 132 and 232Kevin B Kenny2005-05-101-1/+7
|
* Upgrade the capabilities of time limits by allowing them to fire in the midstdkf2004-12-161-1/+5
| | | | of the processing of the event loop or during a blocking [after]. [Bug 1085023]
* * generic/tclEncoding.c: Different fix for [Bug 1077005].dgp2004-12-041-1/+2
| | | | | | | | | * generic/tclEvent.c: Broke apart TclpSetInitialEncodings() on * generic/tclInt.h: Windows into TclpSetInterfaces(), that is * unix/tclUnixInit.c: fundamentally essential, and the initialization * win/tclWinInit.c: of the system encoding, which is not. Made the TclpSetInterfaces call part of TclInitSubsystems so it cannot be overlooked.
* * generic/tclUtil.c: Updated Tcl_GetNameOfExecutable() todgp2004-12-011-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | * generic/tclEncoding.c: make use of a ProcessGlobalValue for * generic/tclEvent.c: storing the executable name. Added internal routines Tcl(Get|Set)ObjNameOfExecutable() to access that storage in Tcl_Obj, rather than string format. * unix/tclUnixFile.c: Rewrote TclpFindExecutable() to use * win/tclWinFile.c: TclSetObjNameOfExecutable to store the executable name it computes. * generic/tclInt.h: Added internal stub entries for * generic/tclInt.decls: TclpFindExecutable and Tcl(Get|Set)ObjNameOfExecutable. * generic/tclIntDecls.h: make genstubs * generic/tclStubInit.c: * generic/tclCmdIL.c: Retrieve executable name in Tcl_Obj form * win/tclWinPipe.c: instead of string form. * unix/tclUnixTest.c: Update [testfindexecutable] command to use new internal interfaces.
* Patch 976520 reworks several of the details involved withdgp2004-11-301-144/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | startup/initialization of the Tcl library, focused on the activities of Tcl_FindExecutable(). * generic/tclIO.c: Removed bogus claim in comment that encoding "iso8859-1" is "built-in" to Tcl. * generic/tclInt.h: Created a new struct ProcessGlobalValue, * generic/tclUtil.c: routines Tcl(Get|Set)ProcessGlobalValue, and function type TclInitProcessGlobalValueProc. Together, these take care of the housekeeping for "values" (things that can be held in a Tcl_Obj) that are global across a whole process. That is, they are shared among multiple threads, and epoch and mutex protection must govern the validity of cached copies maintained in each thread. * generic/tclNotify.c: Modified TclInitNotifier() to tolerate being called multiple times in the same thread. * generic/tclEvent.c: Dropped the unused argv0 argument to TclInitSubsystems(). Removed machinery to unsure only one TclInitNotifier() call per thread, now that that is safe. Converted Tcl(Get|Set)LibraryPath to use a ProcessGlobalValue, and moved them to tclEncoding.c. * generic/tclBasic.c: Updated caller. * generic/tclInt.h: TclpFindExecutable now returns void. * unix/tclUnixFile.c: * win/tclWinFile.c: * win/tclWinPipe.c: * generic/tclEncoding.c: Built new encoding search initialization on a foundation of ProcessGlobalValues, exposing new routines Tcl(Get|Set)EncodingSearchPath. A cache of a map from encoding name to directory pathname keeps track of where encodings are available for loading. Tcl_FindExecutable greatly simplified into just three function calls. The "library path" is now misnamed, as its only remaining purpose is as a foundation for the default encoding search path. * generic/tclInterp.c: Inlined the initScript that is evaluated by Tcl_Init(). Added verification after initScript evaluation that Tcl can find its installed *.enc files, and that it has initialized [encoding system] in agreement with what the environment expects. [tclInit] no longer driven by the value of $::tcl_libPath; it largely constructs its own search path now, rather than attempt to share one with the encoding system. * unix/tclUnixInit.c: TclpSetInitialEncodings factored so that a new * win/tclWinInit.c: routine TclpGetEncodingNameFromEnvironment can reveal that Tcl thinks the [encoding system] should be, even when an incomplete encoding search path, or a missing *.enc file won't allow that initialization to succeed. TclpInitLibraryPath reworked as an initializer of a ProcessGlobalValue. * unix/tclUnixTest.c: Update implementations of [testfindexecutable], [testgetdefenc], and [testsetdefenc]. * tests/unixInit.test: Corrected tests to operate properly even when a value of TCL_LIBRARY is required to find encodings. * generic/tclInt.decls: New internal stubs: TclGetEncodingSearchPath, TclSetEncodingSearchPath, TclpGetEncodingNameFromEnvironment. These are candidates for public exposure by future TIPs. * generic/tclIntDecls.h: make genstubs * generic/tclStubInit.c: * generic/tclTest.c: Updated [testencoding] to use * tests/encoding.test: Tcl(Get|Set)EncodingSearchPath. Updated tests.
* * generic/tclEvent.c (HandleBgErrors): Simplified program flow.dgp2004-11-181-14/+10
|
* TIP #221 IMPLEMENTATIONdgp2004-11-131-120/+237
| | | | | | | | | | | | | | | | | | | | | | | | | * generic/tclBasic.c: Define [::tcl::Bgerror] in new interps. * generic/tclEvent.c: Update Tcl_BackgroundError to make use of the registered [interp bgerror] command. * generic/tclInterp.c: New [interp bgerror] subcommand. * tests/interp.test: syntax tests updated. TIP #226 IMPLEMENTATION * generic/tcl.decls: Stubs for Tcl_(Save|Restore|Discard)InterpState * generic/tcl.h: New public opaque type, Tcl_InterpState. * generic/tclInt.h: Drop old private declarations. Add Tcl(Get|Set)BgErrorHandler * generic/tclResult.c: Tcl_*InterpState implementations. * generic/tclDictObj.c: Update callers. * generic/tclIOGT.c: * generic/tclTrace.c: TIP #227 IMPLEMENTATION * generic/tcl.decls: Stubs for Tcl_(Get|Set)ReturnOptions. * generic/tclInt.h: Drop old private declarations. * generic/tclResult.c: Tcl_*ReturnOptions implementations. * generic/tclCmdAH.c: Update callers. * generic/tclMain.c:
* * generic/tclBasic.c (Tcl_LogCommandInfo,Tcl_AddObjErrorInfo):dgp2004-10-241-37/+28
| | | | | | | | | | | | | | Shift the initialization of errorCode to NONE to more central location. * generic/tclEvent.c (BgError,Tcl_BackgroundError,HandleBgErrors): Rewrite to build on the new TclGet/SetReturnOptions routines. * generic/tclResult.c (TclGetReturnOptions): Add call to Tcl_AddObjErrorInfo to be sure error fields are initialized. * generic/tclResult.c (TclTransferResult): Rewrite to build on the new TclGet/SetReturnOptions routines.
* * generic/tclInt.h (Tcl*InterpState): New internal routinesdgp2004-10-191-5/+2
| | | | | | | | | | | | | | | | | | | | | * generic/tclResult.c (Tcl*InterpState): TclSaveInterpState, TclRestoreInterpState, and TclDiscardInterpState are superior replacements for Tcl_(Save|Restore|Discard)Result. Intent is that these routines will be converted to public routines after TIP approval. * generic/tclBasic.c (TclEvalObjvInternal): * generic/tclDictObj.c (DictUpdateCmd, DictWithCmd): * generic/tclIOGT.c (ExecuteCallback): * generic/tclTrace.c (Trace*Proc,TclCheck*Traces,TclCallVarTraces): Callers of Tcl_*Result updated to call the new routines. The calls were relocated in several cases to perform save/restore operations only when needed. * generic/tclEvent.c (HandleBgErrors): * generic/tclFCmd.c (CopyRenameOneFile): Calls to Tcl_*Result that were eliminated because they appeared to serve no useful purpose, typically saving/restoring an error message, only to throw it away.
* * generic/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp,dgp2004-10-151-99/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TclEvalObjvInternal,Tcl_LogCommandInfo,TclAddObjErrorInfo): * generic/tclCmdAH.c (Tcl_CatchObjCmd): * generic/tclEvent.c (BgError,ErrAssocData,Tcl_BackgroundError, HandleBgErrors,BgErrorDeleteProc): * generic/tclExecute.c (TclCreateExecEnv,TclDeleteExecEnv): * generic/tclIOUtil.c (comments only): * generic/tclInt.h (ExecEnv,Interp, ERR_IN_PROGRESS): * generic/tclInterp.c ([tclInit]): * generic/tclMain.c (comments only): * generic/tclNamesp.c (Tcl_CreateNamespace,Tcl_DeleteNamespace,TclTeardownNamespace): * generic/tclProc.c (TclUpdateReturnInfo): * generic/tclResult.c (Tcl_ResetResult,TclTransferResult): * generic/tclTrace.c (CallVarTraces): Reworked management of the "errorInfo" data of an interp. That information is now primarily stored in a new private (Tcl_Obj *) field of the Interp struct, rather than using a global variable ::errorInfo as the primary storage. The ERR_IN_PROGRESS flag bit value is no longer required to manage the value in its new location, and is removed. Variable traces are established to support compatibility for any code expecting the ::errorInfo variable to hold the information. ***POTENTIAL INCOMPATIBILITY*** Code that sets traces on the ::errorInfo variable may notice a difference in timing of the firing of those traces. Code that uses the value ERR_IN_PROGRESS.
* * generic/tclBasic.c (Tcl_CreateInterp,Tcl_DeleteInterp,dgp2004-10-051-11/+15
| | | | | | | | | | | | | | | | | | | | TclEvalObjvInternal,Tcl_LogCommandInfo): * generic/tclCmdAH.c (Tcl_CatchObjCmd): * generic/tclEvent.c (BgError,Tcl_BackgroundError,HandleBgErrors): * generic/tclInt.h (Interp, ERROR_CODE_SET): * generic/tclNamesp.c (Tcl_CreateNamespace,Tcl_DeleteNamespace,TclTeardownNamespace): * generic/tclResult.c (Tcl_ResetResult,Tcl_SetObjErrorCode,TclTransferResult): * generic/tclTrace.c (CallVarTraces): Reworked management of the "errorCode" data of an interp. That information is now primarily stored in a new private (Tcl_Obj *) field of the Interp struct, rather than using a global variable ::errorCode as the primary storage. The ERROR_CODE_SET flag bit value is no longer required to manage the value in its new location, and is removed. Variable traces are established to support compatibility for any code expecting the ::errorCode variable to hold the information.
* * generic/tclBasic.c: Removed internal routines TclInvoke,dgp2004-09-271-7/+15
| | | | | | | | | | | | | | | * generic/tclInt.decls: TclGlobalInvoke, TclObjInvokeGlobal and * tests/basic.test: the portion of TclObjInvoke that handles calls without TCL_INVOKE_HIDDEN enabled. None of this code is called any longer within the core, and the superior public interface, Tcl_EvalObjv, is available for any external callers. * generic/tclIntDecls.h: make genstubs * generic/tclStubInit.c: * generic/tclEvent.c (HandleBgErrors): Updated [bgerror] invocations to make use of Tcl_Obj based routines, dropping the calls to TclGlobalInvoke()
* * generic/tclEvent.c (Tcl_Finalize): Re-organized Tcl_Finalizedgp2004-07-301-24/+24
| | | | | so that Tcl_ExitProc's that call Tcl_Finalize recursively do not cause deadlock. [Patch 999084 fixes Tk Bug 714956]
* * generic/tclEvent.c: Correct threaded obj allocator tohobbs2004-07-211-2/+4
| | | | | | | * generic/tclInt.h: fully cleanup on exit and allow for * generic/tclThreadAlloc.c: reinitialization. [Bug #736426] * unix/tclUnixThrd.c: (mistachkin, kenny) * win/tclWinThrd.c:
* Stuffed memory leak incurred by re-initializing of TSD slotsvasiljevic2004-07-151-6/+19
| | | | | | | | | | | | after the last call to TclFinalizeThreadData (done from within Tcl_FinalizeThread()). We basically just repeat the TclFinalizeThreadData() once more before tearing down TSD keys in TclFinalizeSynchronization(). There should be more elaborate mechanism in place for handling such issues, based on thread cleanup handlers registered on the OS level. Such change requires much more work and would also require TIP because some visible parts of Tcl API would have to be modified. In the meantime, this will do.