Skip to content

Commit

Permalink
rename to ResolvingLock
Browse files Browse the repository at this point in the history
Signed-off-by: longfangsong <[email protected]>
  • Loading branch information
longfangsong committed Apr 21, 2022
1 parent 4e5f60a commit 64d6e44
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions txnkv/txnlock/lock_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,10 @@ type LockResolver struct {
asyncResolveCancel func()
}

type LockInfo struct {
// ResolvingLock stands for current resolving locks' infomation
type ResolvingLock struct {
TxnID uint64
LockTxnId uint64
LockTxnID uint64
Key []byte
Primary []byte
}
Expand Down Expand Up @@ -455,15 +456,15 @@ func (lr *LockResolver) ResolveLocksDone(callerStartTS uint64) {
lr.mu.Unlock()
}

func (lr *LockResolver) Resolving() []LockInfo {
result := []LockInfo{}
func (lr *LockResolver) Resolving() []ResolvingLock {
result := []ResolvingLock{}
lr.mu.RLock()
defer lr.mu.RUnlock()
for txnID, item := range lr.mu.resolving {
for _, lock := range item {
result = append(result, LockInfo{
result = append(result, ResolvingLock{
TxnID: txnID,
LockTxnId: lock.TxnID,
LockTxnID: lock.TxnID,
Key: lock.Key,
Primary: lock.Primary,
})
Expand Down

0 comments on commit 64d6e44

Please sign in to comment.