atomic.go 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2014 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. // +build !arm
  5. package runtime
  6. import "unsafe"
  7. //go:noescape
  8. func xadd(ptr *uint32, delta int32) uint32
  9. //go:noescape
  10. func xadd64(ptr *uint64, delta int64) uint64
  11. //go:noescape
  12. func xchg(ptr *uint32, new uint32) uint32
  13. //go:noescape
  14. func xchg64(ptr *uint64, new uint64) uint64
  15. //go:noescape
  16. func xchgp(ptr unsafe.Pointer, new unsafe.Pointer) unsafe.Pointer
  17. //go:noescape
  18. func xchguintptr(ptr *uintptr, new uintptr) uintptr
  19. //go:noescape
  20. func atomicload(ptr *uint32) uint32
  21. //go:noescape
  22. func atomicload64(ptr *uint64) uint64
  23. //go:noescape
  24. func atomicloadp(ptr unsafe.Pointer) unsafe.Pointer
  25. //go:noescape
  26. func atomicor8(ptr *uint8, val uint8)
  27. //go:noescape
  28. func cas64(ptr *uint64, old, new uint64) bool
  29. //go:noescape
  30. func atomicstore(ptr *uint32, val uint32)
  31. //go:noescape
  32. func atomicstore64(ptr *uint64, val uint64)
  33. //go:noescape
  34. func atomicstorep(ptr unsafe.Pointer, val unsafe.Pointer)