• Russ Cox's avatar
    runtime: add timer support, use for package time · 3b860269
    Russ Cox authored
    This looks like it is just moving some code from
    time to runtime (and translating it to C), but the
    runtime can do a better job managing the goroutines,
    and it needs this functionality for its own maintenance
    (for example, for the garbage collector to hand back
    unused memory to the OS on a time delay).
    Might as well have just one copy of the timer logic,
    and runtime can't depend on time, so vice versa.
    
    It also unifies Sleep, NewTicker, and NewTimer behind
    one mechanism, so that there are no claims that one
    is more efficient than another.  (For example, today
    people recommend using time.After instead of time.Sleep
    to avoid blocking an OS thread.)
    
    Fixes #1644.
    Fixes #1731.
    Fixes #2190.
    
    R=golang-dev, r, hectorchu, iant, iant, jsing, alex.brainman, dvyukov
    CC=golang-dev
    https://golang.org/cl/5334051
    3b860269
Name
Last commit
Last update
..
Makefile Loading commit data...
format.go Loading commit data...
internal_test.go Loading commit data...
sleep.go Loading commit data...
sleep_test.go Loading commit data...
sys.go Loading commit data...
sys_plan9.go Loading commit data...
sys_unix.go Loading commit data...
sys_windows.go Loading commit data...
tick.go Loading commit data...
tick_test.go Loading commit data...
time.go Loading commit data...
time_test.go Loading commit data...
zoneinfo_plan9.go Loading commit data...
zoneinfo_posix.go Loading commit data...
zoneinfo_unix.go Loading commit data...
zoneinfo_windows.go Loading commit data...