Commit 3c0fbeea authored by Ian Lance Taylor's avatar Ian Lance Taylor

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: default avatarCherry Zhang <cherryyz@google.com>
parent d51f7f39
......@@ -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
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment