mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
avoid deleting the entry too early
This commit is contained in:
parent
c43238b30a
commit
10ac25f857
|
@ -135,7 +135,7 @@ func (lt *LockTable[T]) ReleaseLock(key T, lock *ActiveLock) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there are no waiters, release the lock
|
// If there are no waiters, release the lock
|
||||||
if len(entry.waiters) == 0 {
|
if len(entry.waiters) == 0 && entry.activeExclusiveLockOwnerCount <= 0 && entry.activeSharedLockOwnerCount <= 0 {
|
||||||
delete(lt.locks, key)
|
delete(lt.locks, key)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue