diff options
Diffstat (limited to 'third_party/gvsync')
-rw-r--r-- | third_party/gvsync/BUILD | 2 | ||||
-rw-r--r-- | third_party/gvsync/atomicptr_unsafe.go | 12 | ||||
-rw-r--r-- | third_party/gvsync/atomicptrtest/BUILD | 6 | ||||
-rw-r--r-- | third_party/gvsync/seqatomic_unsafe.go | 2 | ||||
-rw-r--r-- | third_party/gvsync/seqatomictest/BUILD | 6 | ||||
-rw-r--r-- | third_party/gvsync/seqatomictest/seqatomic_test.go | 2 |
6 files changed, 20 insertions, 10 deletions
diff --git a/third_party/gvsync/BUILD b/third_party/gvsync/BUILD index 04a1fbeba..8dab51daa 100644 --- a/third_party/gvsync/BUILD +++ b/third_party/gvsync/BUILD @@ -40,7 +40,7 @@ go_library( "race_unsafe.go", "seqcount.go", ], - importpath = "gvisor.googlesource.com/gvisor/third_party/gvsync", + importpath = "gvisor.dev/gvisor/third_party/gvsync", ) go_test( diff --git a/third_party/gvsync/atomicptr_unsafe.go b/third_party/gvsync/atomicptr_unsafe.go index 53a943282..525c4beed 100644 --- a/third_party/gvsync/atomicptr_unsafe.go +++ b/third_party/gvsync/atomicptr_unsafe.go @@ -21,8 +21,18 @@ type Value struct{} // Note that copying AtomicPtr by value performs a non-atomic read of the // stored pointer, which is unsafe if Store() can be called concurrently; in // this case, do `dst.Store(src.Load())` instead. +// +// +stateify savable type AtomicPtr struct { - ptr unsafe.Pointer + ptr unsafe.Pointer `state:".(*Value)"` +} + +func (p *AtomicPtr) savePtr() *Value { + return p.Load() +} + +func (p *AtomicPtr) loadPtr(v *Value) { + p.Store(v) } // Load returns the value set by the most recent Store. It returns nil if there diff --git a/third_party/gvsync/atomicptrtest/BUILD b/third_party/gvsync/atomicptrtest/BUILD index 74c51fd18..6cf69ea91 100644 --- a/third_party/gvsync/atomicptrtest/BUILD +++ b/third_party/gvsync/atomicptrtest/BUILD @@ -6,7 +6,7 @@ load("//tools/go_generics:defs.bzl", "go_template_instance") go_template_instance( name = "atomicptr_int", - out = "atomicptr_int.go", + out = "atomicptr_int_unsafe.go", package = "atomicptr", suffix = "Int", template = "//third_party/gvsync:generic_atomicptr", @@ -17,8 +17,8 @@ go_template_instance( go_library( name = "atomicptr", - srcs = ["atomicptr_int.go"], - importpath = "gvisor.googlesource.com/gvisor/third_party/gvsync/atomicptr", + srcs = ["atomicptr_int_unsafe.go"], + importpath = "gvisor.dev/gvisor/third_party/gvsync/atomicptr", ) go_test( diff --git a/third_party/gvsync/seqatomic_unsafe.go b/third_party/gvsync/seqatomic_unsafe.go index c52d378f1..382eeed43 100644 --- a/third_party/gvsync/seqatomic_unsafe.go +++ b/third_party/gvsync/seqatomic_unsafe.go @@ -13,7 +13,7 @@ import ( "strings" "unsafe" - "gvisor.googlesource.com/gvisor/third_party/gvsync" + "gvisor.dev/gvisor/third_party/gvsync" ) // Value is a required type parameter. diff --git a/third_party/gvsync/seqatomictest/BUILD b/third_party/gvsync/seqatomictest/BUILD index d83149e81..9e87e0bc5 100644 --- a/third_party/gvsync/seqatomictest/BUILD +++ b/third_party/gvsync/seqatomictest/BUILD @@ -6,7 +6,7 @@ load("//tools/go_generics:defs.bzl", "go_template_instance") go_template_instance( name = "seqatomic_int", - out = "seqatomic_int.go", + out = "seqatomic_int_unsafe.go", package = "seqatomic", suffix = "Int", template = "//third_party/gvsync:generic_seqatomic", @@ -17,8 +17,8 @@ go_template_instance( go_library( name = "seqatomic", - srcs = ["seqatomic_int.go"], - importpath = "gvisor.googlesource.com/gvisor/third_party/gvsync/seqatomic", + srcs = ["seqatomic_int_unsafe.go"], + importpath = "gvisor.dev/gvisor/third_party/gvsync/seqatomic", deps = [ "//third_party/gvsync", ], diff --git a/third_party/gvsync/seqatomictest/seqatomic_test.go b/third_party/gvsync/seqatomictest/seqatomic_test.go index 2da73cf96..a5447f589 100644 --- a/third_party/gvsync/seqatomictest/seqatomic_test.go +++ b/third_party/gvsync/seqatomictest/seqatomic_test.go @@ -19,7 +19,7 @@ import ( "testing" "time" - "gvisor.googlesource.com/gvisor/third_party/gvsync" + "gvisor.dev/gvisor/third_party/gvsync" ) func TestSeqAtomicLoadUncontended(t *testing.T) { |