1
0
mirror of https://github.com/golang/go synced 2024-11-18 00:24:48 -07:00

runtime: disable preemption during test calls to futexsleep

Fixes #35347

Change-Id: If7380f29e97a5abe86cdd5e2853323de7997ccfc
Reviewed-on: https://go-review.googlesource.com/c/go/+/205378
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
This commit is contained in:
Ian Lance Taylor 2019-11-04 20:45:48 -08:00
parent d51f7f3970
commit 3c0fbeea7d

View File

@ -6,5 +6,14 @@
package runtime
var Futexsleep = futexsleep
var Futexwakeup = futexwakeup
//go:nosplit
func Futexsleep(addr *uint32, val uint32, ns int64) {
// Temporarily disable preemption so that a preemption signal
// doesn't interrupt the system call.
poff := debug.asyncpreemptoff
debug.asyncpreemptoff = 1
futexsleep(addr, val, ns)
debug.asyncpreemptoff = poff
}