diff options
| author | Russ Cox <rsc@golang.org> | 2015-07-22 15:31:54 -0400 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2015-07-22 20:28:47 +0000 |
| commit | 75d779566b75fc1a09239bfbca40b6dba42000fd (patch) | |
| tree | 0f3a523e92a3e8b67ed61b32a0bbfdca039a2747 /src/runtime | |
| parent | 0acecb7164133ee235809d642711b46b340221cb (diff) | |
| download | go-75d779566b75fc1a09239bfbca40b6dba42000fd.tar.xz | |
runtime/cgo: make compatible with race detector
Some routines run without and m or g and cannot invoke the
race detector runtime. They must be opaque to the runtime.
That used to be true because they were written in C.
Now that they are written in Go, disable the race detector
annotations for those functions explicitly.
Add test.
Fixes #10874.
Change-Id: Ia8cc28d51e7051528f9f9594b75634e6bb66a785
Reviewed-on: https://go-review.googlesource.com/12534
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/cgo/callbacks.go | 1 | ||||
| -rw-r--r-- | src/runtime/sigqueue.go | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/cgo/callbacks.go b/src/runtime/cgo/callbacks.go index 1682341596..08f230d47e 100644 --- a/src/runtime/cgo/callbacks.go +++ b/src/runtime/cgo/callbacks.go @@ -37,6 +37,7 @@ var _runtime_cgo_panic_internal byte //go:cgo_export_static _cgo_panic //go:cgo_export_dynamic _cgo_panic //go:nosplit +//go:norace func _cgo_panic(a unsafe.Pointer, n int32) { _runtime_cgocallback(unsafe.Pointer(&_runtime_cgo_panic_internal), a, uintptr(n)) } diff --git a/src/runtime/sigqueue.go b/src/runtime/sigqueue.go index e078bfaf0e..3f50a59c14 100644 --- a/src/runtime/sigqueue.go +++ b/src/runtime/sigqueue.go @@ -164,6 +164,7 @@ func signal_ignore(s uint32) { // This runs on a foreign stack, without an m or a g. No stack split. //go:nosplit +//go:norace func badsignal(sig uintptr) { cgocallback(unsafe.Pointer(funcPC(badsignalgo)), noescape(unsafe.Pointer(&sig)), unsafe.Sizeof(sig)) } |
