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: |
50c5d9ac11c96d308345b786b264b983 |
| 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
Modified ChangeLog
from [1ac11d65b8]
to [c99001b487].
[diff]
Modified generic/tcl.h
from [35241d327a]
to [67a248cc84].
[diff]
Modified generic/tclInt.h
from [00b8e15e18]
to [c31dba546e].
[diff]
Modified generic/tclObj.c
from [8ceadd10b1]
to [3a946db587].
[diff]