MCPcopy
hub / github.com/osrg/gobgp / Stop

Method Stop

pkg/server/server.go:4985–5005  ·  view source on GitHub ↗

nolint:errcheck // we don't care about the error here.

()

Source from the content-addressed store, hash-verified

4983
4984//nolint:errcheck // we don't care about the error here.
4985func (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
5007func (s *BgpServer) isWatched(typ watchEventType) bool {
5008 s.watcherMu.RLock()

Callers 3

StopMethod · 0.45
WatchEventMethod · 0.45

Calls 2

cleanInfiniteChannelFunction · 0.85
mgmtOperationMethod · 0.80