github.com/comwrg/go/src@v0.0.0-20220319063731-c238d0440370/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 //go:build dragonfly || freebsd || linux 6 // +build dragonfly freebsd linux 7 8 package runtime 9 10 var Futexwakeup = futexwakeup 11 12 //go:nosplit 13 func Futexsleep(addr *uint32, val uint32, ns int64) { 14 // Temporarily disable preemption so that a preemption signal 15 // doesn't interrupt the system call. 16 poff := debug.asyncpreemptoff 17 debug.asyncpreemptoff = 1 18 futexsleep(addr, val, ns) 19 debug.asyncpreemptoff = poff 20 }