Russ Cox
fc7b9fc269
time: allow sleep tests to run for 200% too long
...
Some VMs are slow. Very slow.
Fixes #2421 .
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5482049
2011-12-12 18:33:47 -05:00
David Symonds
2949f3b659
time: use Duration for AfterFunc.
...
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5465043
2011-12-08 15:42:44 +11:00
Russ Cox
efe3d35fc5
time: new Time, Duration, ZoneInfo types
...
R=r, bradfitz, gri, dsymonds, iant
CC=golang-dev
https://golang.org/cl/5392041
2011-11-30 11:59:44 -05:00
Dmitriy Vyukov
a899a467f2
time: fix timer stop
...
Due to data structure corruption,
some timers could not be removed.
Fixes #2495 .
R=golang-dev, adg
CC=golang-dev, mdbrown
https://golang.org/cl/5437060
2011-11-25 14:13:10 +03:00
Dmitriy Vyukov
ba98a7ee5e
time: fix test hang
...
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5374083
2011-11-14 22:31:39 +03:00
Dmitriy Vyukov
dc6726b37f
runtime: fix timers crash
...
Timer callbacks occasionally crash
with "sched while holding locks" message.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5381043
2011-11-14 21:59:48 +03:00
Russ Cox
965845a86d
all: sort imports
...
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5319072
2011-11-02 15:54:16 -04:00
Russ Cox
eb6929299b
src/pkg/[n-z]*: gofix -r error -force=error
...
R=golang-dev, bsiegert, iant
CC=golang-dev
https://golang.org/cl/5294074
2011-11-01 22:05:34 -04:00
Russ Cox
75d337e84b
time: fix zone during windows test
...
Factor out sleep interrupt.
Fixes #1109 .
R=alex.brainman, go.peter.90, mattn.jp
CC=golang-dev
https://golang.org/cl/4968041
2011-08-26 15:15:23 -04:00
Andrew Gerrand
5bcbcab311
sort: rename helpers: s/Sort// in sort.Sort[Float64s|Ints|Strings]
...
Includes 'sorthelpers' gofix and updates to tree.
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/4631098
2011-07-08 10:52:50 +10:00
Andrew Gerrand
d54c4ecc32
time: make TestAfterQueuing retry 3 times before declaring failure.
...
I'm in two minds as to whether this should be a function of gotest.
Tests that can flake out like this should be rare enough that we
needn't add more mechanism.
R=r
CC=golang-dev
https://golang.org/cl/4335042
2011-03-30 11:40:00 +11:00
Russ Cox
f4e76d8309
replace non-blocking send, receive syntax with select
...
R=golang-dev, nigeltao, niemeyer, r
CC=golang-dev
https://golang.org/cl/4079053
2011-01-31 18:36:28 -05:00
Roger Peppe
2ae953bfc3
time: allow cancelling of After events.
...
Also simplify sleeper algorithm and poll
occasionally so redundant sleeper goroutines
will quit sooner.
R=r, niemeyer, r2
CC=golang-dev
https://golang.org/cl/4063043
2011-01-25 12:25:48 -08:00
Roger Peppe
212e074be2
time: add AfterFunc to call a function after a given duration.
...
The After code is trivially generalisable to provide support
for this, and it is possible to use AfterFunc to do
things that After cannot, such as waiting
for many events at varied times without an overhead
of one goroutine per event.
R=rsc, r
CC=golang-dev
https://golang.org/cl/3905041
2011-01-10 11:51:38 -08:00
Russ Cox
6eee9ed507
time: fix build
...
Allow less precise timing on build machines.
TBR=r
CC=golang-dev
https://golang.org/cl/3391043
2010-12-06 16:22:32 -05:00
Roger Peppe
e2d1595c81
time: make After use fewer goroutines and host processes.
...
With credit to Gustavo Niemeyer, who hinted at this approach
in #go-nuts.
R=adg, rsc, niemeyer, r
CC=golang-dev
https://golang.org/cl/3416043
2010-12-06 14:19:30 -05:00
Andrew Gerrand
1e66a21348
time: add After
...
Permits one to easily put a timeout in a select:
select {
case <-ch:
// foo
case <-time.After(1e6):
// bar
}
R=r, rog, rsc, sameer1, PeterGo, iant, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/2321043
2010-10-11 13:45:26 +11:00
Christopher Wedgwood
1e66428d59
time: Sleep through interruptions
...
R=rsc
CC=golang-dev
https://golang.org/cl/202043
2010-02-04 13:09:02 -08:00