Unlock releases lk's owner's locks within its namespace over lk's range.
(key string, lk Range)
| 152 | |
| 153 | // Unlock releases lk's owner's locks within its namespace over lk's range. |
| 154 | func (m *Manager) Unlock(key string, lk Range) { |
| 155 | m.mu.Lock() |
| 156 | defer m.mu.Unlock() |
| 157 | s := m.byKey[key] |
| 158 | if s == nil { |
| 159 | return |
| 160 | } |
| 161 | s.Release(lk) |
| 162 | m.afterRelease(key, s, lk.Sid) |
| 163 | } |
| 164 | |
| 165 | // GetLk reports the lock that would block proposed on key, if any. |
| 166 | func (m *Manager) GetLk(key string, proposed Range) (Range, bool) { |