MCPcopy
hub / github.com/google/gvisor / Lock

Struct Lock

pkg/sentry/fsimpl/lock/lock.go:112–122  ·  view source on GitHub ↗

Lock is a regional file lock. It consists of either a single writer or a set of readers. A Lock may be upgraded from a read lock to a write lock only if there is a single reader and that reader has the same uid as the write lock. A Lock may be downgraded from a write lock to a read lock only if t

Source from the content-addressed store, hash-verified

110//
111// +stateify savable
112type Lock struct {
113 // Readers are the set of read lock holders identified by UniqueID.
114 // If len(Readers) > 0 then Writer must be nil.
115 Readers map[UniqueID]OwnerInfo
116
117 // Writer holds the writer unique ID. It's nil if there are no writers.
118 Writer UniqueID
119
120 // WriterInfo describes the writer. It is only meaningful if Writer != nil.
121 WriterInfo OwnerInfo
122}
123
124// Locks is a thread-safe wrapper around a LockSet.
125//

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected