]> go.fuhry.dev Git - fsnotify.git/commitdiff
kqueue: fix incorrect mutex used in Close()
authorNathan Youngman <git@nathany.com>
Sat, 5 Jul 2014 02:15:51 +0000 (20:15 -0600)
committerNathan Youngman <git@nathany.com>
Sat, 5 Jul 2014 02:15:51 +0000 (20:15 -0600)
identified at https://code.google.com/p/go/issues/detail?id=8282#c5

fsnotify_bsd.go

index dcb14da56c26288f1864b1a814bf3e6ff1e76897..33da394bf2cfd3dcb0e07a03e17d439a79b24e58 100644 (file)
@@ -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)
        }