aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/export_unix_test.go
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2019-10-28 22:14:04 -0400
committerAustin Clements <austin@google.com>2019-10-29 13:46:21 +0000
commitb6bdf4587f7b58b78982553b7d10b73d0a381152 (patch)
tree7e5898f3dcdb0ef7bee579ec17227d75dda7c1ae /src/runtime/export_unix_test.go
parentac346a5fd99711e94996cae030cad1064da1daf2 (diff)
downloadgo-b6bdf4587f7b58b78982553b7d10b73d0a381152.tar.gz
go-b6bdf4587f7b58b78982553b7d10b73d0a381152.zip
runtime: unblock SIGUSR1 for TestPreemptM
TestPreemptM tests signal delivery using SIGUSR1, but (for unknown reasons) SIGUSR1 is blocked by default on android/arm and android/arm64, causing the test to fail. This fixes the test by ensuring that SIGUSR1 is unblocked for this test. Updates #10958, #24543. Change-Id: I9f81fbab53f96c74622aabcb6f5276f79e2b6d33 Reviewed-on: https://go-review.googlesource.com/c/go/+/203957 Run-TryBot: Austin Clements <austin@google.com> Reviewed-by: Cherry Zhang <cherryyz@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/export_unix_test.go')
-rw-r--r--src/runtime/export_unix_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime/export_unix_test.go b/src/runtime/export_unix_test.go
index 3f8bff619d..7af1c1dd54 100644
--- a/src/runtime/export_unix_test.go
+++ b/src/runtime/export_unix_test.go
@@ -33,6 +33,10 @@ var waitForSigusr1 struct {
// the ID of the M the SIGUSR1 was received on. If no SIGUSR1 is
// received for timeoutNS nanoseconds, it returns -1.
func WaitForSigusr1(ready func(mp *M), timeoutNS int64) (int64, int64) {
+ lockOSThread()
+ // Make sure we can receive SIGUSR1.
+ unblocksig(_SIGUSR1)
+
mp := getg().m
testSigusr1 = func(gp *g) bool {
waitForSigusr1.mp = gp.m
@@ -46,6 +50,8 @@ func WaitForSigusr1(ready func(mp *M), timeoutNS int64) (int64, int64) {
waitForSigusr1.mp = nil
testSigusr1 = nil
+ unlockOSThread()
+
if !ok {
return -1, -1
}