mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #9366 from gyuho/rafthttp-mu
rafthttp: make "ActiveSince" non-blocking on write lock
This commit is contained in:
commit
f802cd9db2
@ -338,8 +338,8 @@ func (t *Transport) UpdatePeer(id types.ID, us []string) {
|
||||
}
|
||||
|
||||
func (t *Transport) ActiveSince(id types.ID) time.Time {
|
||||
t.mu.Lock()
|
||||
defer t.mu.Unlock()
|
||||
t.mu.RLock()
|
||||
defer t.mu.RUnlock()
|
||||
if p, ok := t.peers[id]; ok {
|
||||
return p.activeSince()
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user