]> Cypherpunks repositories - gostls13.git/commit
runtime: account for callbacks in checkdead on Windows
authorIan Lance Taylor <iant@golang.org>
Fri, 26 Apr 2019 05:39:56 +0000 (22:39 -0700)
committerIan Lance Taylor <iant@golang.org>
Mon, 29 Apr 2019 22:35:35 +0000 (22:35 +0000)
commit98c5a56f0178db479c71fa76b5791ce2fcfc58b9
tree328524cdc87ce8696432f7a10ad0570f6e86dfd0
parentccbc9a3f9f6479070f5a45a8583d14d158b8bcb0
runtime: account for callbacks in checkdead on Windows

When a callback runs on a different thread in Windows, as in the
runtime package test TestCallbackInAnotherThread, it will use the
extra M. That can cause the test in checkdead to fail incorrectly.
Check whether there actually is an extra M before expecting it.

I think this is a general problem unrelated to timers. I think the test
was passing previously because the timer goroutine was using an M.
But I haven't proved that. This change seems correct, and it avoids
the test failure when using the new timers on Windows.

Updates #27707

Change-Id: Ieb31c04ff0354d6fae7e173b59bcfadb8b0464cd
Reviewed-on: https://go-review.googlesource.com/c/go/+/174037
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/proc.go