mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
clientv3/ordering: acquire setPrevRev mutex only when needed
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
e44ce19c1f
commit
69031e3a6d
@ -43,10 +43,10 @@ func (kv *kvOrdering) getPrevRev() int64 {
|
||||
|
||||
func (kv *kvOrdering) setPrevRev(currRev int64) {
|
||||
prevRev := kv.getPrevRev()
|
||||
kv.revMu.Lock()
|
||||
defer kv.revMu.Unlock()
|
||||
if currRev > prevRev {
|
||||
kv.revMu.Lock()
|
||||
kv.prevRev = currRev
|
||||
kv.revMu.Unlock()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user