| 1 |
// Copyright 2012 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 race && ((linux && (amd64 || arm64 || loong64 || ppc64le || riscv64 || s390x)) || ((freebsd || netbsd || openbsd || windows) && amd64)) |
| 6 |
|
| 7 |
package race |
| 8 |
|
| 9 |
// This file merely ensures that we link in runtime/cgo in race build, |
| 10 |
// this in turn ensures that runtime uses pthread_create to create threads. |
| 11 |
// The prebuilt race runtime lives in race_GOOS_GOARCH.syso. |
| 12 |
// Calls to the runtime are done directly from src/runtime/race.go. |
| 13 |
|
| 14 |
// On darwin we always use system DLLs to create threads, |
| 15 |
// so we use race_darwin_$GOARCH.go to provide the syso-derived |
| 16 |
// symbol information without needing to invoke cgo. |
| 17 |
// This allows -race to be used on Mac systems without a C toolchain. |
| 18 |
|
| 19 |
// void __race_unused_func(void); |
| 20 |
import "C" |