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

baseToken.WaitTimeout can not return earlier even if the operation has failed with an error #382

Closed
stonelgh opened this issue Nov 3, 2019 · 1 comment · Fixed by #383

Comments

@stonelgh
Copy link

stonelgh commented Nov 3, 2019

Both baseToken.WaitTimeout and baseToken.setError acquire the lock before proceeding. It results in that baseToken.WaitTimeout can not return earlier even if the operation has failed with an error. Is it by design or a logic flaw?

@MattBrittan
Copy link
Contributor

Well spotted; it looks like the mutex lock was adeded ages ago when the WaitTimeout function accessed a struct variable (.ready). As it only accesses the channel now I have submitted pull request #383 to remove the lock (and add a test that demonstrates that this fixes the issue)

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.

2 participants