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

issue with time/tick #593

Closed
gopherbot opened this issue Feb 8, 2010 · 2 comments
Closed

issue with time/tick #593

gopherbot opened this issue Feb 8, 2010 · 2 comments

Comments

@gopherbot
Copy link
Contributor

by yglgogo:

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. the issue can be repro with the following code:
package main

import ( "time"; "fmt" )

func main() {
    t0 := time.NewTicker(1e9)
    t0.Stop()
    time.Sleep(1e9)
    for i := 0; i < 3; i++ {
        ticker := time.NewTicker(5e8)
        select {
        case <-ticker.C:
            fmt.Printf("time out for reqest %d\n", i)
        }
        ticker.Stop()
    }
    fmt.Printf("client exit\n")
}

2. should see 3 "time out" printouts
3. deadlock instead

What is the expected output? What do you see instead?

2. should see 3 "time out" printouts
3. deadlock instead


What is your $GOOS?  $GOARCH?

GOARCH=386
GOOS=linux

Which revision are you using?  (hg identify)

db4262ce882d+ release.2010-02-04/release

Please provide any additional information below.
tried some changes to tick.go (attached), seems working, not sure if it is 
a complete fix.

Attachments:

  1. tick.go (4751 bytes)
@rsc
Copy link
Contributor

rsc commented Feb 16, 2010

Comment 1:

->r for triage.

Labels changed: added packagebug.

Owner changed to r...@golang.org.

@robpike
Copy link
Contributor

robpike commented Feb 17, 2010

Comment 2:

This issue was closed by revision 7b76175.

Status changed to Fixed.

Merged into issue #-.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc unassigned robpike Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants