mirror of
https://github.com/golang/go
synced 2024-09-30 06:34:29 -06: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:
parent
d51f7f3970
commit
3c0fbeea7d
@ -6,5 +6,14 @@
|
|||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
var Futexsleep = futexsleep
|
|
||||||
var Futexwakeup = futexwakeup
|
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
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user