diff options
author | mig <mig> | 2011-03-01 19:54:54 (GMT) |
---|---|---|
committer | mig <mig> | 2011-03-01 19:54:54 (GMT) |
commit | ad4787470445d29656797ce0f19af1ad478eb4e2 (patch) | |
tree | de9c73c4a60bfd332bded0a6a1e50acb0c703d96 /generic/tclInt.h | |
parent | d21c0a8aa8925c53e28bd8150874092356620f65 (diff) | |
download | tcl-ad4787470445d29656797ce0f19af1ad478eb4e2.zip tcl-ad4787470445d29656797ce0f19af1ad478eb4e2.tar.gz tcl-ad4787470445d29656797ce0f19af1ad478eb4e2.tar.bz2 |
This is [Patch 3168398], Joe Mistachkin's optimisation of Tip #285
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index f759593..cbb5600 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -2184,6 +2184,22 @@ typedef struct Interp { *((iPtr)->asyncReadyPtr) /* + * Macros for script cancellation support (TIP #285). + */ + +#define TclCanceled(iPtr) \ + (((iPtr)->flags & CANCELED) || ((iPtr)->flags & TCL_CANCEL_UNWIND)) + +#define TclSetCancelFlags(iPtr, cancelFlags) \ + (iPtr)->flags |= CANCELED; \ + if ((cancelFlags) & TCL_CANCEL_UNWIND) { \ + (iPtr)->flags |= TCL_CANCEL_UNWIND; \ + } + +#define TclUnsetCancelFlags(iPtr) \ + (iPtr)->flags &= (~(CANCELED | TCL_CANCEL_UNWIND)) + +/* * General list of interpreters. Doubly linked for easier removal of items * deep in the list. */ |