go types_64bit 源码

  • 2022-07-15
  • 浏览 (794)

golang types_64bit 代码

文件路径:/src/runtime/internal/atomic/types_64bit.go

// Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build amd64 || arm64 || mips64 || mips64le || ppc64 || ppc64le || riscv64 || s390x || wasm

package atomic

// LoadAcquire is a partially unsynchronized version
// of Load that relaxes ordering constraints. Other threads
// may observe operations that precede this operation to
// occur after it, but no operation that occurs after it
// on this thread can be observed to occur before it.
//
// WARNING: Use sparingly and with great care.
func (u *Uint64) LoadAcquire() uint64 {
	return LoadAcq64(&u.value)
}

// StoreRelease is a partially unsynchronized version
// of Store that relaxes ordering constraints. Other threads
// may observe operations that occur after this operation to
// precede it, but no operation that precedes it
// on this thread can be observed to occur after it.
//
// WARNING: Use sparingly and with great care.
func (u *Uint64) StoreRelease(value uint64) {
	StoreRel64(&u.value, value)
}

相关信息

go 源码目录

相关文章

go atomic_386 源码

go atomic_amd64 源码

go atomic_arm 源码

go atomic_arm64 源码

go atomic_loong64 源码

go atomic_mips64x 源码

go atomic_mipsx 源码

go atomic_ppc64x 源码

go atomic_riscv64 源码

go atomic_s390x 源码

0  赞