blob: 2fe524058d676d0fad29a1457cd5ff6a31380d93 [file] [log] [blame]
Dmitriy Vyukov2f6cbc72012-10-07 22:05:32 +04001// 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// +build race
6
7// Public race detection API, present iff build with -race.
8
9package runtime
10
11import (
12 "unsafe"
13)
14
Robert Griesemer465b9c32012-10-30 13:38:01 -070015// RaceDisable disables handling of race events in the current goroutine.
Dmitriy Vyukov2f6cbc72012-10-07 22:05:32 +040016func RaceDisable()
17
Robert Griesemer465b9c32012-10-30 13:38:01 -070018// RaceEnable re-enables handling of race events in the current goroutine.
Dmitriy Vyukov2f6cbc72012-10-07 22:05:32 +040019func RaceEnable()
20
21func RaceAcquire(addr unsafe.Pointer)
22func RaceRelease(addr unsafe.Pointer)
23func RaceReleaseMerge(addr unsafe.Pointer)
24
Dmitriy Vyukov51e89f592012-11-14 16:51:23 +040025func RaceRead(addr unsafe.Pointer)
26func RaceWrite(addr unsafe.Pointer)
Dmitriy Vyukovfc807642013-06-10 22:40:35 +040027func RaceReadRange(addr unsafe.Pointer, len int)
28func RaceWriteRange(addr unsafe.Pointer, len int)
Dmitriy Vyukov51e89f592012-11-14 16:51:23 +040029
Dmitriy Vyukov2f6cbc72012-10-07 22:05:32 +040030func RaceSemacquire(s *uint32)
31func RaceSemrelease(s *uint32)
Keith Randall61dca942014-06-16 23:03:03 -070032
33// private interface for the runtime
34const raceenabled = true