]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: disable preemption during test calls to futexsleep
authorIan Lance Taylor <iant@golang.org>
Tue, 5 Nov 2019 04:45:48 +0000 (20:45 -0800)
committerIan Lance Taylor <iant@golang.org>
Tue, 5 Nov 2019 05:22:07 +0000 (05:22 +0000)
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>
src/runtime/export_futex_test.go

index 5e272364d1ffbb02e66ade19670a338be3d0ed76..a727a9311450b292f818c3d79bf0e274f4521ac8 100644 (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
+}