summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/tcltk/tcl/0005-tcl-fix-race-in-interp.test.patch
blob: 07912da5b38b9f6492fd96af5547a8d172ab9829 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
From fd75e3613613726786c54a25ee611c5176b33510 Mon Sep 17 00:00:00 2001
From: Ross Burton <ross.burton@arm.com>
Date: Mon, 12 Jul 2021 14:50:13 +0100
Subject: [PATCH] tcl: fix race in interp.test

The interp-36.7 patch has race conditions and is missing cleanup.  This patch by
a Tcl maintainer should improve matters.

Upstream-Status: Pending
Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 tests/interp.test | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/interp.test b/tests/interp.test
index 0092a03..eecfd3b 100644
--- a/tests/interp.test
+++ b/tests/interp.test
@@ -3614,17 +3614,18 @@ test interp-36.7 {ChildBgerror sets error handler of child [1999035]} -setup {
 	variable result
 	set result [lindex $args 0]
     }
+    set tout [after 5000 {set result timeout}]
 } -body {
     child eval {
 	variable done {}
 	after 0 error foo
-	after 10 [list ::set [namespace which -variable done] {}]
-	vwait [namespace which -variable done]
     }
+    vwait result
     set result
 } -cleanup {
+    after cancel $tout
     variable result {}
-    unset -nocomplain result
+    unset -nocomplain result tout
     interp delete child
 } -result foo