Skip to content

Commit

Permalink
server: inline waitForServerConnRemoval, finishEventLog
Browse files Browse the repository at this point in the history
  • Loading branch information
fho committed Oct 30, 2023
1 parent d976997 commit 702ac45
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -1885,18 +1885,15 @@ func (s *Server) stop(graceful bool) {
s.stopServerWorkers()
}

s.waitForServerConnRemoval()
s.finishEventLog()
}

// waitForServerConnRemoval blocks until s.conns is empty.
//
// s.mu must be held by the caller.
func (s *Server) waitForServerConnRemoval() {
for len(s.conns) != 0 {
s.cv.Wait()
}
s.conns = nil

if s.events != nil {
s.events.Finish()
s.events = nil
}
}

// s.mu must be held by the caller.
Expand All @@ -1920,14 +1917,6 @@ func (s *Server) drainAllServerTransports() {
}
}

// s.mu must be held by the caller.
func (s *Server) finishEventLog() {
if s.events != nil {
s.events.Finish()
s.events = nil
}
}

// s.mu must be held by the caller.
func (s *Server) closeListeners() {
for lis := range s.lis {
Expand Down

0 comments on commit 702ac45

Please sign in to comment.