|
From: SourceForge.net <no...@so...> - 2005-06-15 22:42:14
|
Bugs item #1221395, was opened at 2005-06-15 18:29 Message generated for change (Settings changed) made by dkf You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1221395&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 20. [interp] Group: current: 8.5a3 Status: Open Resolution: None >Priority: 8 Submitted By: Nobody/Anonymous (nobody) >Assigned to: Donal K. Fellows (dkf) Summary: Cannot break 'vwait' with Tcl_LimitSetTime Initial Comment: Tcl 8.5a3, Windows 2000 It is impossible to stop interpreter from outside ('master' C code) by using Tcl_LimitSetTime when script is executing vwait command. The following code was written in 'master': limitTime.usec = 1; limitTime.sec = 0; Tcl_LimitSetGranularity( interp, TCL_LIMIT_TIME, 1 ); Tcl_LimitTypeSet( interp, TCL_LIMIT_TIME ); Tcl_LimitSetTime( interp, &limitTime ); Tcl_LimitCheck( interp ); and doesn't work (I suspect that Tcl_LimitTypeSet() should be enough indeed) I've modified TCL sources a bit and it started to work but I don't know TCL sources well, so this could be a bad way. In tclInterp.c, Tcl_LimitCheck() (Send alert each time limit check is hit) ... > Tcl_Preserve(interp); > RunLimitHandlers(iPtr->limit.timeHandlers, interp); + Tcl_ThreadAlert( NULL ); > if (iPtr->limit.time.sec > now.sec || ... In tclNotify.c, Tcl_ThreadAlert() (support for 'broadcast' events, without exact threadId known) ... > for (tsdPtr = firstNotifierPtr; tsdPtr; tsdPtr = tsdPtr- >nextPtr) { + if ((threadId == NULL) || (tsdPtr->threadId == threadId)) { > if (tclStubs.tcl_AlertNotifier) { ... And the last thing is that even after all that done Tcl_WaitForEvent returns 0 and Tcl_DoOneEvent() do not warns vwait about changes happened, so I had to make Tcl_WaitForEvent always return 1. I believe there can be a graceful solution of this problem (if there IS problem). nyrl at mail dot ru ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=1221395&group_id=10894 |