github.com/geraldss/go/src@v0.0.0-20210511222824-ac7d0ebfc235/runtime/sys_openbsd1.go (about)

     1  // Copyright 2020 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 openbsd,amd64
     6  
     7  package runtime
     8  
     9  import "unsafe"
    10  
    11  //go:nosplit
    12  //go:cgo_unsafe_args
    13  func thrsleep(ident uintptr, clock_id int32, tsp *timespec, lock uintptr, abort *uint32) int32 {
    14  	return libcCall(unsafe.Pointer(funcPC(thrsleep_trampoline)), unsafe.Pointer(&ident))
    15  }
    16  func thrsleep_trampoline()
    17  
    18  //go:nosplit
    19  //go:cgo_unsafe_args
    20  func thrwakeup(ident uintptr, n int32) int32 {
    21  	return libcCall(unsafe.Pointer(funcPC(thrwakeup_trampoline)), unsafe.Pointer(&ident))
    22  }
    23  func thrwakeup_trampoline()
    24  
    25  func osyield() {
    26  	libcCall(unsafe.Pointer(funcPC(sched_yield_trampoline)), unsafe.Pointer(nil))
    27  }
    28  func sched_yield_trampoline()
    29  
    30  //go:cgo_import_dynamic libc_thrsleep __thrsleep "libc.so"
    31  //go:cgo_import_dynamic libc_thrwakeup __thrwakeup "libc.so"
    32  //go:cgo_import_dynamic libc_sched_yield sched_yield "libc.so"
    33  
    34  //go:cgo_import_dynamic _ _ "libc.so"