Source file src/internal/race/race.go

     1  // Copyright 2015 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  //go:build race
     6  
     7  package race
     8  
     9  import (
    10  	"internal/abi"
    11  	"unsafe"
    12  )
    13  
    14  const Enabled = true
    15  
    16  // Functions below pushed from runtime.
    17  
    18  //go:linkname Acquire
    19  func Acquire(addr unsafe.Pointer)
    20  
    21  //go:linkname Release
    22  func Release(addr unsafe.Pointer)
    23  
    24  //go:linkname ReleaseMerge
    25  func ReleaseMerge(addr unsafe.Pointer)
    26  
    27  //go:linkname Disable
    28  func Disable()
    29  
    30  //go:linkname Enable
    31  func Enable()
    32  
    33  //go:linkname Read
    34  func Read(addr unsafe.Pointer)
    35  
    36  //go:linkname ReadPC
    37  func ReadPC(addr unsafe.Pointer, callerpc, pc uintptr)
    38  
    39  //go:linkname ReadObjectPC
    40  func ReadObjectPC(t *abi.Type, addr unsafe.Pointer, callerpc, pc uintptr)
    41  
    42  //go:linkname Write
    43  func Write(addr unsafe.Pointer)
    44  
    45  //go:linkname WritePC
    46  func WritePC(addr unsafe.Pointer, callerpc, pc uintptr)
    47  
    48  //go:linkname WriteObjectPC
    49  func WriteObjectPC(t *abi.Type, addr unsafe.Pointer, callerpc, pc uintptr)
    50  
    51  //go:linkname ReadRange
    52  func ReadRange(addr unsafe.Pointer, len int)
    53  
    54  //go:linkname WriteRange
    55  func WriteRange(addr unsafe.Pointer, len int)
    56  
    57  //go:linkname Errors
    58  func Errors() int
    59  

View as plain text