]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: eliminate excessive notewakeup calls in timers
authorDmitriy Vyukov <dvyukov@google.com>
Tue, 13 Aug 2013 10:14:24 +0000 (14:14 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Tue, 13 Aug 2013 10:14:24 +0000 (14:14 +0400)
If the timer goroutine is wakeup by timeout,
other goroutines will still notewakeup because sleeping is still set.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12763043

src/pkg/runtime/time.goc

index 4f20300ff11225fd2fe938a18dc86499e25540ae..6670b45ba99bcc3cc2289f217d14682652752c8a 100644 (file)
@@ -175,6 +175,7 @@ timerproc(void)
 
        for(;;) {
                runtime·lock(&timers);
+               timers.sleeping = false;
                now = runtime·nanotime();
                for(;;) {
                        if(timers.len == 0) {