github.com/golang-haiku/go-1.4.3@v0.0.0-20190609233734-1f5ae41cc308/src/sync/race.go (about)

     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  // +build race
     6  
     7  package sync
     8  
     9  import (
    10  	"runtime"
    11  	"unsafe"
    12  )
    13  
    14  const raceenabled = true
    15  
    16  func raceAcquire(addr unsafe.Pointer) {
    17  	runtime.RaceAcquire(addr)
    18  }
    19  
    20  func raceRelease(addr unsafe.Pointer) {
    21  	runtime.RaceRelease(addr)
    22  }
    23  
    24  func raceReleaseMerge(addr unsafe.Pointer) {
    25  	runtime.RaceReleaseMerge(addr)
    26  }
    27  
    28  func raceDisable() {
    29  	runtime.RaceDisable()
    30  }
    31  
    32  func raceEnable() {
    33  	runtime.RaceEnable()
    34  }
    35  
    36  func raceRead(addr unsafe.Pointer) {
    37  	runtime.RaceRead(addr)
    38  }
    39  
    40  func raceWrite(addr unsafe.Pointer) {
    41  	runtime.RaceWrite(addr)
    42  }