github.com/rafaeltorres324/go/src@v0.0.0-20210519164414-9fdf653a9838/runtime/export_futex_test.go (about) 1 // Copyright 2013 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // +build dragonfly freebsd linux 6 7 package runtime 8 9 var Futexwakeup = futexwakeup 10 11 //go:nosplit 12 func Futexsleep(addr *uint32, val uint32, ns int64) { 13 // Temporarily disable preemption so that a preemption signal 14 // doesn't interrupt the system call. 15 poff := debug.asyncpreemptoff 16 debug.asyncpreemptoff = 1 17 futexsleep(addr, val, ns) 18 debug.asyncpreemptoff = poff 19 }