From: Nathan Youngman Date: Sat, 5 Jul 2014 02:15:51 +0000 (-0600) Subject: kqueue: fix incorrect mutex used in Close() X-Git-Tag: v1.7.2~297 X-Git-Url: https://go.fuhry.dev/?a=commitdiff_plain;h=ba032e1444ac7314910cf61ca3b1f0dde3baed7d;p=fsnotify.git kqueue: fix incorrect mutex used in Close() identified at https://code.google.com/p/go/issues/detail?id=8282#c5 --- diff --git a/fsnotify_bsd.go b/fsnotify_bsd.go index dcb14da..33da394 100644 --- a/fsnotify_bsd.go +++ b/fsnotify_bsd.go @@ -101,9 +101,9 @@ func (w *Watcher) Close() error { // Send "quit" message to the reader goroutine w.done <- true - w.pmut.Lock() + w.wmut.Lock() ws := w.watches - w.pmut.Unlock() + w.wmut.Unlock() for name := range ws { w.Remove(name) }