func (t *timer) disable() {
	if t.state != timerStateDisabled {
		t.state = timerStateOrphaned
	}
}
disable disables the timer, leaving it in an orphaned state if it wasn't
already disabled.
package tcp
import (
	"time"
	"github.com/brewlin/net-protocol/pkg/sleep"
)
type timerState int
const (
	timerStateDisabled timerState = iota
	timerStateEnabled
	timerStateOrphaned
)
type timer struct {
	state timerState
	target time.Time
	runtimeTarget time.Time
	timer *time.Timer
}
func (t *timer) init(w *sleep.Waker) {
	t.state = timerStateDisabled
	t.timer = time.AfterFunc(time.Hour, func() {
		w.Assert()
	})
	t.timer.Stop()
}
func (t *timer) cleanup() {
	t.timer.Stop()
}
func (t *timer) checkExpiration() bool {
	if t.state == timerStateOrphaned {
		t.state = timerStateDisabled
		return false
	}
	now := time.Now()
	if now.Before(t.target) {
		t.runtimeTarget = t.target
		t.timer.Reset(t.target.Sub(now))
		return false
	}
	t.state = timerStateDisabled
	return true
}