add lock on close

merge_conn
fangdingjun 6 years ago
parent 3409e5e702
commit 503997660b

@ -317,6 +317,9 @@ func (c *ServerConn) serve(s *ServerStream) {
// Close close the server connection // Close close the server connection
func (c *ServerConn) Close() error { func (c *ServerConn) Close() error {
c.lock.Lock()
defer c.lock.Unlock()
if c.closed { if c.closed {
return nil return nil
} }

Loading…
Cancel
Save