coreos/etcd — pull request #725 by dougm (2014-04-15 00:19:37+00:00)
Title: fix(server): avoid race conditions in Run/Stop

- don't close ready channel until PeerServer is listening.
avoids possible panic in Stop() if PeerServer is nil.

- avoid data race in Run() (err variable was shared between 2 goroutines)

- avoid data race in PeerServer Start/Stop (PeerServer.closeChan)