summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/kernel/futex/atomicptr_bucket.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-06-25 17:00:56 +0000
committergVisor bot <gvisor-bot@google.com>2019-06-25 17:00:56 +0000
commit47eed32a5f43f9f17420f44d68bf251135f77ce6 (patch)
treebf36188dd241f5718f750e1e8ec6915c63a5699c /pkg/sentry/kernel/futex/atomicptr_bucket.go
parent97b3e461d427c10537f58755bc1b307a5548b092 (diff)
parent03ae91c662869a37ba71dd2577d4e218a3aa4669 (diff)
Merge 03ae91c6 (automated)
Diffstat (limited to 'pkg/sentry/kernel/futex/atomicptr_bucket.go')
-rwxr-xr-xpkg/sentry/kernel/futex/atomicptr_bucket.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/pkg/sentry/kernel/futex/atomicptr_bucket.go b/pkg/sentry/kernel/futex/atomicptr_bucket.go
index 2251a6e72..d3fdf09b0 100755
--- a/pkg/sentry/kernel/futex/atomicptr_bucket.go
+++ b/pkg/sentry/kernel/futex/atomicptr_bucket.go
@@ -11,8 +11,18 @@ import (
// 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 AtomicPtrBucket struct {
- ptr unsafe.Pointer
+ ptr unsafe.Pointer `state:".(*bucket)"`
+}
+
+func (p *AtomicPtrBucket) savePtr() *bucket {
+ return p.Load()
+}
+
+func (p *AtomicPtrBucket) loadPtr(v *bucket) {
+ p.Store(v)
}
// Load returns the value set by the most recent Store. It returns nil if there