summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-03-08 15:50:37 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-03-08 15:50:37 (GMT)
commitc31b2f4c54d596aafee955890527c1b2406093b1 (patch)
tree67ac64279db5155fba47909bbb85b9b27407cd24 /generic
parent59cd185389899d1a0c9ac1c1eee90a23cae887e2 (diff)
parentfa311630abcb2439d3c9701efbfc94ad0041d86d (diff)
downloadtcl-c31b2f4c54d596aafee955890527c1b2406093b1.zip
tcl-c31b2f4c54d596aafee955890527c1b2406093b1.tar.gz
tcl-c31b2f4c54d596aafee955890527c1b2406093b1.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. See test iocmd.tf-24.17.bug3522560 .
Diffstat (limited to 'generic')
-rw-r--r--generic/tclIORChan.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c
index 21c766e..f476a1a 100644
--- a/generic/tclIORChan.c
+++ b/generic/tclIORChan.c
@@ -1609,8 +1609,6 @@ ReflectWatch(
return;
}
- rcPtr->interest = mask;
-
/*
* Are we in the correct thread?
*/
@@ -1633,6 +1631,7 @@ ReflectWatch(
Tcl_Preserve(rcPtr);
+ rcPtr->interest = mask;
maskObj = DecodeEventMask(mask);
/* assert maskObj.refCount == 1 */
(void) InvokeTclMethod(rcPtr, METH_WATCH, maskObj, NULL, NULL);
@@ -3083,6 +3082,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);