|
@ -89,7 +89,6 @@ func (lt *LockTable[T]) AcquireLock(intention string, key T, lockType LockType) |
|
|
entry.cond.Broadcast() |
|
|
entry.cond.Broadcast() |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
entry.activeLockOwnerCount++ |
|
|
|
|
|
|
|
|
|
|
|
// Otherwise, grant the lock
|
|
|
// Otherwise, grant the lock
|
|
|
entry.lockType = lockType |
|
|
entry.lockType = lockType |
|
@ -102,6 +101,7 @@ func (lt *LockTable[T]) AcquireLock(intention string, key T, lockType LockType) |
|
|
fmt.Printf("\n") |
|
|
fmt.Printf("\n") |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
entry.activeLockOwnerCount++ |
|
|
entry.mu.Unlock() |
|
|
entry.mu.Unlock() |
|
|
|
|
|
|
|
|
return lock |
|
|
return lock |
|
|