blob: 2e0dc94cff1bb80624a29db6cf0b80763b1991fa [file] [log] [blame]
Patrick Williams44b3caf2024-04-12 16:51:14 -05001From 426aa2ff62dda77fd011e8f630b9d4ea17984817 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com>
3Date: Mon, 12 Jul 2021 14:50:13 +0100
4Subject: [PATCH] tcl: fix race in interp.test
5
Andrew Geissler5f350902021-07-23 13:09:54 -04006The interp-36.7 patch has race conditions and is missing cleanup. This patch by
7a Tcl maintainer should improve matters.
8
9Upstream-Status: Pending
10Signed-off-by: Ross Burton <ross.burton@arm.com>
Patrick Williams44b3caf2024-04-12 16:51:14 -050011---
12 tests/interp.test | 7 ++++---
13 1 file changed, 4 insertions(+), 3 deletions(-)
Andrew Geissler5f350902021-07-23 13:09:54 -040014
15diff --git a/tests/interp.test b/tests/interp.test
Patrick Williams44b3caf2024-04-12 16:51:14 -050016index d742484..fc90990 100644
Andrew Geissler5f350902021-07-23 13:09:54 -040017--- a/tests/interp.test
18+++ b/tests/interp.test
19@@ -3595,17 +3595,18 @@ test interp-36.7 {ChildBgerror sets error handler of child [1999035]} -setup {
20 variable result
21 set result [lindex $args 0]
22 }
23+ set tout [after 5000 {set result timeout}]
24 } -body {
25 child eval {
26 variable done {}
27 after 0 error foo
28- after 10 [list ::set [namespace which -variable done] {}]
29- vwait [namespace which -variable done]
30 }
31+ vwait result
32 set result
33 } -cleanup {
34+ after cancel $tout
35 variable result {}
36- unset -nocomplain result
37+ unset -nocomplain result tout
38 interp delete child
39 } -result foo
40