func()

in image/resources/knfsd-fsidd/socket.go [193:210]


func (s *server) trackConnection(c *connection, add bool) {
	s.mu.Lock()
	defer s.mu.Unlock()

	if s.connections == nil {
		s.connections = make(map[*connection]struct{})
	}
	if add {
		s.connections[c] = struct{}{}
	} else {
		delete(s.connections, c)
		if len(s.connections) == 0 && s.shuttingDown() {
			// When the last connection is closed signal the condition in case
			// shutdown is waiting.
			s.c.Signal()
		}
	}
}