summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-03-08 15:52:23 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-03-08 15:52:23 (GMT)
commit56cafd677815347cec86687bfb1b0f7a7254b5ed (patch)
treeed49e9b9895b4e9553566df940b7d5d14ce7d0a6
parentcb8a60a6ee4e02cddf216ca580ab3790bc310e80 (diff)
downloadtcl-56cafd677815347cec86687bfb1b0f7a7254b5ed.zip
tcl-56cafd677815347cec86687bfb1b0f7a7254b5ed.tar.gz
tcl-56cafd677815347cec86687bfb1b0f7a7254b5ed.tar.bz2
[bbc304f61a] Avoid event handling when reflected channel has a watch
change half-completed. (First half in 1 thread, second in another). When this is allowed to happen, false alarm errors from [chan postevent] are the result when timing is unlucky.
-rw-r--r--generic/tclIORChan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c
index c9939d6..85cbec4 100644
--- a/generic/tclIORChan.c
+++ b/generic/tclIORChan.c
@@ -1515,8 +1515,6 @@ ReflectWatch(
return;
}
- rcPtr->interest = mask;
-
/*
* Are we in the correct thread?
*/
@@ -1539,6 +1537,7 @@ ReflectWatch(
Tcl_Preserve(rcPtr);
+ rcPtr->interest = mask;
maskObj = DecodeEventMask(mask);
/* assert maskObj.refCount == 1 */
(void) InvokeTclMethod(rcPtr, METH_WATCH, maskObj, NULL, NULL);
@@ -2887,6 +2886,7 @@ ForwardProc(
/* assert maskObj.refCount == 1 */
Tcl_Preserve(rcPtr);
+ rcPtr->interest = paramPtr->watch.mask;
(void) InvokeTclMethod(rcPtr, METH_WATCH, maskObj, NULL, NULL);
Tcl_DecrRefCount(maskObj);
Tcl_Release(rcPtr);