nolint:errcheck // we don't care about the error here.
()
| 4983 | |
| 4984 | //nolint:errcheck // we don't care about the error here. |
| 4985 | func (w *watcher) Stop() { |
| 4986 | w.s.mgmtOperation(func() error { |
| 4987 | w.s.watcherMu.Lock() |
| 4988 | for k, l := range w.s.watcherMap { |
| 4989 | for i, v := range l { |
| 4990 | if w == v { |
| 4991 | w.s.watcherMap[k] = append(l[:i], l[i+1:]...) |
| 4992 | break |
| 4993 | } |
| 4994 | } |
| 4995 | } |
| 4996 | w.s.watcherMu.Unlock() |
| 4997 | |
| 4998 | cleanInfiniteChannel(w.ch) |
| 4999 | // the loop function goroutine might be blocked for |
| 5000 | // writing to realCh. make sure it finishes. |
| 5001 | for range w.realCh { |
| 5002 | } |
| 5003 | return nil |
| 5004 | }, false) |
| 5005 | } |
| 5006 | |
| 5007 | func (s *BgpServer) isWatched(typ watchEventType) bool { |
| 5008 | s.watcherMu.RLock() |