aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/sync/race.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/sync/race.go')
-rw-r--r--libgo/go/sync/race.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/libgo/go/sync/race.go b/libgo/go/sync/race.go
new file mode 100644
index 0000000..d9431af
--- /dev/null
+++ b/libgo/go/sync/race.go
@@ -0,0 +1,34 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build race
+
+package sync
+
+import (
+ "runtime"
+ "unsafe"
+)
+
+const raceenabled = true
+
+func raceAcquire(addr unsafe.Pointer) {
+ runtime.RaceAcquire(addr)
+}
+
+func raceRelease(addr unsafe.Pointer) {
+ runtime.RaceRelease(addr)
+}
+
+func raceReleaseMerge(addr unsafe.Pointer) {
+ runtime.RaceReleaseMerge(addr)
+}
+
+func raceDisable() {
+ runtime.RaceDisable()
+}
+
+func raceEnable() {
+ runtime.RaceEnable()
+}