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
| 110 | // |
| 111 | // +stateify savable |
| 112 | type 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 | // |
nothing calls this directly
no outgoing calls
no test coverage detected