Skip to content
Tcl Source Code View Ticket
Login

View Ticket

when i call Tcl_DeleteInterp in new thread ,the program crash

Closed / Invalid1a28e712043054383e458f2a54ba96ead23db699Created 10 years agoUpdated 10 years ago
Descriptionplain2016-12-05 07:15:28
1 . Recently ,when I upgrade the tcl/tk to 8.6.1 from 8.5.9,the program is crash in Tcl_DeleteInterp.After I debug the tcl/tk,I found that in the follow code:
static void
DeleteInterpProc(
    Tcl_Interp *interp)		/* Interpreter to delete. */
{
    ........
    if (!(iPtr->flags & DELETED)) {
	Tcl_Panic("DeleteInterpProc called on interpreter not marked deleted");
    }

}

2. It seems that ,Tcl_DeleteInterp and Tcl_CreateInterp should be called in the same thread? But the code work fine in 8.5.9 .Is there any change done in 8.6.1? 
Thank you
dgpplain2017-01-03 19:47:15
A (Tcl_Interp *) can only be passed into the
Tcl library by the same thread that originally
received it from a call to Tcl_CreateInterp().
This is the "apartment model" for using threads
with Tcl.
Log in (anonymous is fine) to add a comment.