Tcl Source Code

View Ticket
Login
Ticket UUID: 1055836
Title: TclThread_Init called twice?
Type: Bug Version: obsolete: 8.5a2
Submitter: davygrvy Created on: 2004-10-28 03:08:04
Subsystem: 34. tcltest Package Assigned To: davygrvy
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2004-10-28 13:25:53
Resolution: Fixed Closed By: davygrvy
    Closed on: 2004-10-28 06:25:53
Description:
from Tcl_AppInit() of win/tclAppInit.c, Tcltest_Init is
called and from within that, it calls TclThread_Init
(line 710 of generic/tclTest.c), yet Tcl_AppInit calls
TclThread_Init a second time (line 164 of
win/tclAppInit.c).

How is right?  Should Tcl_AppInit be responsible or
Tcltest_Init for loading the thread package that is
part of the test suite?
User Comments: davygrvy added on 2004-10-28 13:25:53:
Logged In: YES 
user_id=7549

changes committed to HEAD.

davygrvy added on 2004-10-28 11:49:47:
Logged In: YES 
user_id=7549

Ok, will do.  Tcl_AppInit calling TclThread_Init shall get
hosed.

I once thought the same about the thread package, but Jeff
wanted the test code to stay within the core itself.  I
don't know he feels lately about it.  A good goal, though.

dgp added on 2004-10-28 11:41:50:
Logged In: YES 
user_id=80530

It's definitely wrong, though
harmless, to have it called
from both places.  Feel free
to make whatever temporary fix
you prefer.

The correct long term fix is
to destroy the phony, obsolete
"Thread 1.0" provided by 
TclThread_Init() completely,
and simply bundle the real,
[load]-able Thread package
with the core.

davygrvy added on 2004-10-28 10:20:55:

File Added - 106783: patch.txt

Logged In: YES 
user_id=7549

Personally, I think the shell should not be responsible as
it is good refactoring.  See attached patch.

Attachments: