Skip to content
Tcl Source Code Check-in [50c5d9ac11]
Login

Check-in [50c5d9ac11]

Overview
Comment: Check that the thread incrementing or decrementing the ref count of a Tcl_Obj is the thread that originally allocated the thread. This fail fast behavior will catch programming errors that allow a single Tcl_Obj to be accessed from multiple threads. * generic/tcl.h (Tcl_Obj): Add allocThread member to Tcl_Obj. This member records the thread id the Tcl_Obj was allocated. It is used to check that any future ref count incr or decr is done from the same thread that allocated the Tcl_Obj. This member is defined only when threads and mem debug are enabled. * generic/tclInt.h (TclNewObj, TclDbNewObj, TclDecrRefCount): Define TclNewObj and TclDbNewObj using TclDbInitNewObj when mem debug is enabled. This fixes a problem where TclNewObj calls did not work the same as TclDbNewObj when mem debug was enabled. * generic/tclObj.c (TclDbInitNewObj, Tcl_DbIncrRefCount, Tcl_DbDecrRefCount): Add new helper to init Tcl_Obj members when mem debug is enabled. Init the allocThread member in TclDbInitNewObj and check it in Tcl_DbIncrRefCount and Tcl_DbDecrRefCount to make sure a Tcl_Obj allocated in one thread is not being acted upon in another thread.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 50c5d9ac11c96d308345b786b264b9834206bb71
User & Date: mdejong on 2003-07-22 00:59:57.000
Other Links: manifest | tags
Context
2003-07-22
03:00
update fixes to changes from core-8-4-branch check-in: 1183f478ed user: dgp tags: trunk
00:59
Check that the thread incrementing or decrementing the ref count of a Tcl_Obj is the thread that ... check-in: 50c5d9ac11 user: mdejong tags: trunk
2003-07-21
17:33
Updated changes with entries up through 8.4.4 release. check-in: 3a89eba1df user: dgp tags: trunk
Changes