Descriptionnet: don't loop to drain wakeup pipe.
The loop always makes an extra system call. It only makes a
difference if more than 100 goroutines started waiting for
something to happen on a network file descriptor since the
last time the pipe was drained, which is unlikely since we
will be woken up the first time a goroutine starts waiting.
If we don't drain the pipe this time, we'll be woken up again
right away and can drain again.
Patch Set 1 #Patch Set 2 : diff -r 38937f4e4d1f https://go.googlecode.com/hg/ #
MessagesTotal messages: 5
|