Source file src/runtime/cgo/cgo_windows.go

     1  // Copyright 2026 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 goexperiment.runtimecgopurego && !msan && !tsan && windows
     6  
     7  package cgo
     8  
     9  import (
    10  	"internal/abi"
    11  	"unsafe"
    12  )
    13  
    14  //go:cgo_import_dynamic _cgo_SwitchToThread SwitchToThread%0 "kernel32.dll"
    15  //go:linkname _cgo_SwitchToThread _cgo_SwitchToThread
    16  var _cgo_SwitchToThread unsafe.Pointer
    17  
    18  func cgoCallTrampoline()
    19  
    20  //go:nosplit
    21  //go:norace
    22  func cgoCallTrampolinePC() unsafe.Pointer {
    23  	return unsafe.Pointer(abi.FuncPCABI0(cgoCallTrampoline))
    24  }
    25  
    26  //go:nosplit
    27  //go:norace
    28  func cgoYieldWaitRuntimeInit() {
    29  	asmcgocallNoG(uintptr(_cgo_SwitchToThread), 0, 0, 0, 0, 0, 0)
    30  }
    31  
    32  //go:norace
    33  func cgoNotifyRuntimeInitDoneOS() {}
    34  

View as plain text