remove sync.WaitGroup param from ServerTransport.HandleStream

This commit is contained in:
iamqizhao
2015-10-06 16:44:30 -07:00
parent e63d714a45
commit 63a6c4155a
4 changed files with 16 additions and 22 deletions

View File

@ -259,7 +259,8 @@ func (s *Server) Serve(lis net.Listener) error {
s.mu.Unlock()
go func() {
st.HandleStreams(func(stream *transport.Stream, wg *sync.WaitGroup) {
var wg sync.WaitGroup
st.HandleStreams(func(stream *transport.Stream) {
var trInfo *traceInfo
if EnableTracing {
trInfo = &traceInfo{
@ -278,6 +279,7 @@ func (s *Server) Serve(lis net.Listener) error {
wg.Done()
}()
})
wg.Wait()
s.mu.Lock()
delete(s.conns, st)
s.mu.Unlock()