aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-09-24 09:56:28 -0700
committerchrislu <chris.lu@gmail.com>2023-09-24 09:56:28 -0700
commita1292d87302ed56f988d3fc56a9f729e92b52bc0 (patch)
tree3e0952a441e51ed22466ebe16a6e7515c5fdeded
parent76a62859ffaf62bad4e31bbfa7bfdfa28bb7608c (diff)
parent1df42231952d7d9087d8dc476c02d388eda7e871 (diff)
downloadseaweedfs-a1292d87302ed56f988d3fc56a9f729e92b52bc0.tar.xz
seaweedfs-a1292d87302ed56f988d3fc56a9f729e92b52bc0.zip
Merge branch 'fix-lock-table'
-rw-r--r--weed/util/lock_table.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/weed/util/lock_table.go b/weed/util/lock_table.go
index 8ec93f7e7..2e689d330 100644
--- a/weed/util/lock_table.go
+++ b/weed/util/lock_table.go
@@ -20,7 +20,6 @@ type LockEntry struct {
waiters []*ActiveLock // ordered waiters that are blocked by exclusive locks
activeSharedLockOwnerCount int32
activeExclusiveLockOwnerCount int32
- lockType LockType
cond *sync.Cond
}
@@ -93,7 +92,6 @@ func (lt *LockTable[T]) AcquireLock(intention string, key T, lockType LockType)
}
// Otherwise, grant the lock
- entry.lockType = lockType
if glog.V(4) {
fmt.Printf("ActiveLock %d %s locked %+v type=%v with waiters %d active r%d w%d.\n", lock.ID, lock.intention, key, lockType, len(entry.waiters), entry.activeSharedLockOwnerCount, entry.activeExclusiveLockOwnerCount)
if len(entry.waiters) > 0 {
@@ -140,7 +138,7 @@ func (lt *LockTable[T]) ReleaseLock(key T, lock *ActiveLock) {
}
if glog.V(4) {
- fmt.Printf("ActiveLock %d %s unlocked %+v type=%v with waiters %d active r%d w%d.\n", lock.ID, lock.intention, key, entry.lockType, len(entry.waiters), entry.activeSharedLockOwnerCount, entry.activeExclusiveLockOwnerCount)
+ fmt.Printf("ActiveLock %d %s unlocked %+v type=%v with waiters %d active r%d w%d.\n", lock.ID, lock.intention, key, lock.lockType, len(entry.waiters), entry.activeSharedLockOwnerCount, entry.activeExclusiveLockOwnerCount)
if len(entry.waiters) > 0 {
for _, waiter := range entry.waiters {
fmt.Printf(" %d", waiter.ID)