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

buffered_channel::try_push has incorrect documentation #170

Closed
ldionne opened this issue Mar 20, 2018 · 3 comments
Closed

buffered_channel::try_push has incorrect documentation #170

ldionne opened this issue Mar 20, 2018 · 3 comments

Comments

@ldionne
Copy link
Member

ldionne commented Mar 20, 2018

The documentation for buffered_channel::try_push says:

If channel is closed, returns closed. Otherwise enqueues the value in the channel, wakes up a fiber blocked on this->pop(), this->value_pop(), this->pop_wait_for() or this->pop_wait_until() and returns success.

However, this is the behavior of buffered_channel::push. The behavior for try_push should be to return full without blocking when the channel is full. The implementation of try_push seems to agree with me.

@olk
Copy link
Member

olk commented Mar 22, 2018

wakes up a fiber blocked on this->pop(), this->value_pop(), this->pop_wait_for() or this->pop_wait_until()

is correct ... it needs only an addtional description what happens if the channel is full

olk added a commit that referenced this issue Mar 22, 2018
- in context of #170
@olk olk closed this as completed Mar 22, 2018
@olk
Copy link
Member

olk commented Mar 22, 2018

ty

@rkfg-bc
Copy link

rkfg-bc commented Sep 25, 2018

In 1.68 it's changed wrongly, now the try_push and push descriptions are exactly the same while push actually blocks if the buffer is full. The documentation says it doesn't block.

olk added a commit that referenced this issue Oct 2, 2018
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

No branches or pull requests

3 participants