Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect usage of Timer can cause thread blocking #370

Closed
NeJan2020 opened this issue Nov 25, 2022 · 0 comments · Fixed by #369
Closed

Incorrect usage of Timer can cause thread blocking #370

NeJan2020 opened this issue Nov 25, 2022 · 0 comments · Fixed by #369

Comments

@NeJan2020
Copy link
Collaborator

Describe the bug

if !s.timer.Stop() {
<-s.timer.C
}
s.timer.Reset(s.expiredDuration)

Since this timer is listened on by multiple routines, trying to accept the remaining signals in the Timer.C after calling timer.Stop() may cause thread blocking.

@NeJan2020 NeJan2020 changed the title Incorrect use of Timer can cause thread blocking Incorrect usage of Timer can cause thread blocking Nov 25, 2022
@NeJan2020 NeJan2020 linked a pull request Nov 25, 2022 that will close this issue
@dxsup dxsup closed this as completed in #369 Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant