diff options
author | gVisor bot <gvisor-bot@google.com> | 2021-05-04 23:02:46 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-05-04 23:02:46 +0000 |
commit | 3207672c9e2b3f3603f76e7aa801f63cb30a8fe0 (patch) | |
tree | 6a239a4030306ce294e37d8203bdc22d78ae1ccf /pkg | |
parent | e6e0c2b01201293e0b570234819bc1801559d7ec (diff) | |
parent | d496c285aacff88bb858e4efd700aa1e0b2ebad1 (diff) |
Merge release-20210419.0-61-gd496c285a (automated)
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/refs/refcounter.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/pkg/refs/refcounter.go b/pkg/refs/refcounter.go index 6992e1de8..4aecb8007 100644 --- a/pkg/refs/refcounter.go +++ b/pkg/refs/refcounter.go @@ -30,6 +30,9 @@ import ( // RefCounter is the interface to be implemented by objects that are reference // counted. +// +// TODO(gvisor.dev/issue/1624): Get rid of most of this package and replace it +// with refsvfs2. type RefCounter interface { // IncRef increments the reference counter on the object. IncRef() @@ -181,6 +184,9 @@ func (w *WeakRef) zap() { // AtomicRefCount keeps a reference count using atomic operations and calls the // destructor when the count reaches zero. // +// Do not use AtomicRefCount for new ref-counted objects! It is deprecated in +// favor of the refsvfs2 package. +// // N.B. To allow the zero-object to be initialized, the count is offset by // 1, that is, when refCount is n, there are really n+1 references. // @@ -215,8 +221,8 @@ type AtomicRefCount struct { // LeakMode configures the leak checker. type LeakMode uint32 -// TODO(gvisor.dev/issue/1624): Simplify down to two modes once vfs1 ref -// counting is gone. +// TODO(gvisor.dev/issue/1624): Simplify down to two modes (on/off) once vfs1 +// ref counting is gone. const ( // UninitializedLeakChecking indicates that the leak checker has not yet been initialized. UninitializedLeakChecking LeakMode = iota |