mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
d4861911c2
Earlier the atomicbitops_state_autogen.go was not being built because it had an impossible build condition: `(amd64 || arm64) && !amd64 && !arm64`. This is a known deficiency in go_stateify tool. This was solved via having two identical files like 32b_32bit.go and 32b_64bit.go. Just piggyback this. This changes also enhances `atomicbitops.Bool` in the following ways: - Added RacyLoad(), RacyStore() and CompareAndSwap() for Bool to bring it up to speed with the other types. - Delegated the actual atomic operations work to the underlying Uint32. - Cleaned up code with b32(); similar to what sync/atomic.Bool does. PiperOrigin-RevId: 597607982
47 lines
1008 B
Python
47 lines
1008 B
Python
load("//tools:defs.bzl", "go_library", "go_test")
|
|
|
|
package(
|
|
default_applicable_licenses = ["//:license"],
|
|
licenses = ["notice"],
|
|
)
|
|
|
|
go_library(
|
|
name = "atomicbitops",
|
|
srcs = [
|
|
"32b_32bit.go",
|
|
"32b_64bit.go",
|
|
"aligned_32bit_unsafe.go",
|
|
"aligned_64bit.go",
|
|
"atomicbitops.go",
|
|
"atomicbitops_amd64.s",
|
|
"atomicbitops_arm64.go",
|
|
"atomicbitops_arm64.s",
|
|
"atomicbitops_float64.go",
|
|
"atomicbitops_noasm.go",
|
|
],
|
|
visibility = ["//:sandbox"],
|
|
deps = [
|
|
"//pkg/cpuid",
|
|
"//pkg/sync",
|
|
"@org_golang_x_sys//cpu:go_default_library",
|
|
],
|
|
)
|
|
|
|
go_test(
|
|
name = "atomicbitops_benchmark_test",
|
|
size = "small",
|
|
srcs = ["atomicbitops_benchmark_test.go"],
|
|
library = ":atomicbitops",
|
|
)
|
|
|
|
go_test(
|
|
name = "atomicbitops_test",
|
|
size = "small",
|
|
srcs = [
|
|
"aligned_test.go",
|
|
"atomicbitops_test.go",
|
|
],
|
|
library = ":atomicbitops",
|
|
deps = ["//pkg/sync"],
|
|
)
|