github.com/lrita/cache@v1.0.1/race/race.go (about)

     1  // +build race
     2  
     3  package race
     4  
     5  import (
     6  	"runtime"
     7  	"unsafe"
     8  )
     9  
    10  // Enabled represents the -race is enabled or not.
    11  const Enabled = true
    12  
    13  func Acquire(addr unsafe.Pointer)             { runtime.RaceAcquire(addr) }
    14  func Release(addr unsafe.Pointer)             { runtime.RaceRelease(addr) }
    15  func ReleaseMerge(addr unsafe.Pointer)        { runtime.RaceReleaseMerge(addr) }
    16  func Disable()                                { runtime.RaceDisable() }
    17  func Enable()                                 { runtime.RaceEnable() }
    18  func Read(addr unsafe.Pointer)                { runtime.RaceRead(addr) }
    19  func Write(addr unsafe.Pointer)               { runtime.RaceWrite(addr) }
    20  func ReadRange(addr unsafe.Pointer, len int)  { runtime.RaceReadRange(addr, len) }
    21  func WriteRange(addr unsafe.Pointer, len int) { runtime.RaceWriteRange(addr, len) }
    22  func Errors() int                             { return runtime.RaceErrors() }