Keith Randall | 61dca94 | 2014-06-16 23:03:03 -0700 | [diff] [blame] | 1 | // Copyright 2014 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 !race |
| 6 | |
| 7 | // Dummy race detection API, used when not built with -race. |
| 8 | |
| 9 | package runtime |
| 10 | |
Keith Randall | 0c6b55e | 2014-07-16 14:16:19 -0700 | [diff] [blame] | 11 | import ( |
| 12 | "unsafe" |
| 13 | ) |
| 14 | |
Keith Randall | 61dca94 | 2014-06-16 23:03:03 -0700 | [diff] [blame] | 15 | const raceenabled = false |
Keith Randall | 0c6b55e | 2014-07-16 14:16:19 -0700 | [diff] [blame] | 16 | |
Russ Cox | f545b05 | 2014-09-04 15:53:45 -0400 | [diff] [blame] | 17 | // Because raceenabled is false, none of these functions should be called. |
| 18 | |
Keith Randall | b2a950b | 2014-12-27 20:58:00 -0800 | [diff] [blame] | 19 | func raceReadObjectPC(t *_type, addr unsafe.Pointer, callerpc, pc uintptr) { throw("race") } |
| 20 | func raceWriteObjectPC(t *_type, addr unsafe.Pointer, callerpc, pc uintptr) { throw("race") } |
| 21 | func raceinit() uintptr { throw("race"); return 0 } |
| 22 | func racefini() { throw("race") } |
| 23 | func racemapshadow(addr unsafe.Pointer, size uintptr) { throw("race") } |
| 24 | func racewritepc(addr unsafe.Pointer, callerpc, pc uintptr) { throw("race") } |
| 25 | func racereadpc(addr unsafe.Pointer, callerpc, pc uintptr) { throw("race") } |
| 26 | func racereadrangepc(addr unsafe.Pointer, sz, callerpc, pc uintptr) { throw("race") } |
| 27 | func racewriterangepc(addr unsafe.Pointer, sz, callerpc, pc uintptr) { throw("race") } |
| 28 | func raceacquire(addr unsafe.Pointer) { throw("race") } |
| 29 | func raceacquireg(gp *g, addr unsafe.Pointer) { throw("race") } |
| 30 | func racerelease(addr unsafe.Pointer) { throw("race") } |
| 31 | func racereleaseg(gp *g, addr unsafe.Pointer) { throw("race") } |
| 32 | func racereleasemerge(addr unsafe.Pointer) { throw("race") } |
| 33 | func racereleasemergeg(gp *g, addr unsafe.Pointer) { throw("race") } |
| 34 | func racefingo() { throw("race") } |
| 35 | func racemalloc(p unsafe.Pointer, sz uintptr) { throw("race") } |
| 36 | func racegostart(pc uintptr) uintptr { throw("race"); return 0 } |
| 37 | func racegoend() { throw("race") } |