Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
gif001 committed Feb 7, 2025
1 parent 59fe2ad commit 651a602
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions go-utils/gotime/timer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ func NewTimer(duration time.Duration) *Timer {
return &Timer{
duration: duration,
// 使用buffered channels避免阻塞
stop: make(chan struct{}, 1),
pause: make(chan struct{}, 1),
resume: make(chan struct{}, 1),
reset: make(chan time.Duration, 1),
force: make(chan struct{}, 1),
stop: make(chan struct{}, 1),
pause: make(chan struct{}, 1),
resume: make(chan struct{}, 1),
reset: make(chan time.Duration, 1),
force: make(chan struct{}, 1),
isStopped: true,
}
}

Expand Down

0 comments on commit 651a602

Please sign in to comment.