-
Notifications
You must be signed in to change notification settings - Fork 60
api: replaced Future.done with a sync.Cond #508
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
base: master
Are you sure you want to change the base?
Conversation
dd9e78b to
f5ce75f
Compare
oleg-jukovec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the patch. Overall, everything's fine.
I've added some implementation notes, but you need to do a proper rebase first.
|
Please, rebase on the master branch. |
f5ce75f to
d238853
Compare
oleg-jukovec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the patch! I have just a one mirror comment:
This commit reduces allocations. Future.done allocation replaced with - Future.cond (sync.Cond) - Future.finished (atomic.Bool) Other code use Future.isDone() instead (Future.done == nil) check. Added Future.finish() marks Future as done. Future.WaitChan() now creates channel on demand. Closes #496
d238853 to
948fcee
Compare
oleg-jukovec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the patch!
This commit reduces allocations.
Future.done allocation replaced with
Other code use
Future.isDone()insteadFuture.done == nilcheck.Added Future.finish() marks Future as done.
Future.WaitChan() now creates channel on demand.
Closes #496