fix miscompile of static goroutine calls to closures

This commit is contained in:
Jaden Weiss
2019-10-18 19:19:46 -04:00
committed by Ayke
parent 923a6f5873
commit 86ab03c999
5 changed files with 42 additions and 14 deletions
+10
View File
@@ -41,6 +41,16 @@ func main() {
})
time.Sleep(2 * time.Millisecond)
var x int
go func() {
time.Sleep(2 * time.Millisecond)
x = 1
}()
time.Sleep(time.Second/2)
println("closure go call result:", x)
time.Sleep(2 * time.Millisecond)
}
func sub() {
+1
View File
@@ -13,3 +13,4 @@ done with non-blocking goroutine
async interface method call
slept inside func pointer 8
slept inside closure, with value: 20 8
closure go call result: 1