Raft HTTP: fix pause/resume race condition

release-3.4
Nima Yahyazadeh 2019-06-17 11:45:25 -04:00
parent 2c5162af5c
commit b1812a410f
1 changed files with 4 additions and 0 deletions

View File

@ -437,12 +437,16 @@ type Pausable interface {
}
func (t *Transport) Pause() {
t.mu.RLock()
defer t.mu.RUnlock()
for _, p := range t.peers {
p.(Pausable).Pause()
}
}
func (t *Transport) Resume() {
t.mu.RLock()
defer t.mu.RUnlock()
for _, p := range t.peers {
p.(Pausable).Resume()
}