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

time: Ticker.Stop() should close output channel #4366

reusee opened this issue Nov 8, 2012 · 2 comments

time: Ticker.Stop() should close output channel #4366

reusee opened this issue Nov 8, 2012 · 2 comments


Copy link

@reusee reusee commented Nov 8, 2012

What steps will reproduce the problem?

What is the expected output?
program should terminate normally

What do you see instead?

Which compiler are you using (5g, 6g, 8g, gccgo)?

Which operating system are you using?

Which version are you using?  (run 'go version')

Please provide any additional information below.
Copy link

@minux minux commented Nov 8, 2012

Comment 2:

i think fixing this will change behavior of existing program (programs that don't
use comma ok form or range channel form to receive from channels)
The docs for it says:
Stop turns off a ticker. After Stop, no more ticks will be sent.
if we close the channel, i think it is almost equivalent to sending a new (zero) tick.
On the other hand, if we don't close the channel, this means uncollectable
garbage (if the user isn't using another form to notify tick's receiver goroutine,
but that will be rare).
FYI, we have a test in tick_test that verify after Stop(), we won't receive anything
from C.
Copy link

@rsc rsc commented Nov 8, 2012

Comment 3:

Status changed to Duplicate.

Merged into issue #2650.

@rsc rsc added this to the Go1.1 milestone Apr 14, 2015
@rsc rsc removed the go1.1 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.