Revert "Peer timer teardown"

This reverts commit d73f960aab.

Problems with deadlocking arises due to orphaned packets in per-peer
queues. Additional work on this issue continues in seperate branch.
This commit is contained in:
Mathias Hall-Andersen
2018-01-04 14:24:14 +01:00
parent d73f960aab
commit 9360bac632
7 changed files with 102 additions and 163 deletions
+6
View File
@@ -43,6 +43,12 @@ func (t *Timer) Reset(dur time.Duration) {
t.Start(dur)
}
func (t *Timer) Push(dur time.Duration) {
if t.pending.Get() {
t.Reset(dur)
}
}
func (t *Timer) Wait() <-chan time.Time {
return t.timer.C
}