summaryrefslogtreecommitdiffhomepage
path: root/pkg/refsvfs2/refs.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-07-13 01:36:04 +0000
committergVisor bot <gvisor-bot@google.com>2021-07-13 01:36:04 +0000
commit06f349011627d6298168ceac919e27cb166675d4 (patch)
treedf2b179bb06b09baee6d2cd47c714d03ae6d75f2 /pkg/refsvfs2/refs.go
parent289efe127e1f04f4fbb0c2a46050a6cd9c9f3b9b (diff)
parent520795aaad701854e9ffe84de1108954cf2b77f8 (diff)
Merge release-20210705.0-15-g520795aaa (automated)
Diffstat (limited to 'pkg/refsvfs2/refs.go')
-rw-r--r--pkg/refsvfs2/refs.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/refsvfs2/refs.go b/pkg/refsvfs2/refs.go
index ef8beb659..fe3e4a1ca 100644
--- a/pkg/refsvfs2/refs.go
+++ b/pkg/refsvfs2/refs.go
@@ -28,6 +28,11 @@ type RefCounter interface {
// DecRef decrements the object's reference count. Users of refs_template.Refs
// may specify a destructor to be called once the reference count reaches zero.
DecRef(ctx context.Context)
+}
+
+// TryRefCounter is like RefCounter but allow the ref increment to be tried.
+type TryRefCounter interface {
+ RefCounter
// TryIncRef attempts to increment the reference count, but may fail if all
// references have already been dropped, in which case it returns false. If