| Tcl_Cancel(3tcl) | Tcl Library Procedures | Tcl_Cancel(3tcl) |
Tcl_CancelEval, Tcl_Canceled - cancel Tcl scripts
#include <tcl.h> int Tcl_CancelEval(interp, resultObjPtr, clientData, flags) int Tcl_Canceled(interp, flags)
Tcl_CancelEval cancels or unwinds the script in progress soon after the next invocation of asynchronous handlers, causing TCL_ERROR to be the return code for that script. This function is thread-safe and may be called from any thread in the process.
Tcl_Canceled checks if the script in progress has been canceled and returns TCL_ERROR if it has. Otherwise, TCL_OK is returned. Extensions can use this function to check to see if they should abort a long running command. This function is thread sensitive and may only be called from the thread the interpreter was created in.
Any OR'ed combination of the following values may be used for the flags argument to procedures such as Tcl_CancelEval:
Tcl_CancelEval always decrements the reference count of its resultObjPtr argument (if that is non-NULL). It is expected to be usually called with an object with zero reference count. If the object is shared with some other location (including the Tcl evaluation stack) it should have its reference count incremented before calling this function.
interp(3tcl), Tcl_Eval(3tcl), TIP 285
cancel, unwind
| 8.6 | Tcl |