Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

Commit

Permalink
Merge pull request #77 from cespare/bsd-deadlock-fix
Browse files Browse the repository at this point in the history
Fix deadlock on BSD
  • Loading branch information
howeyc committed Nov 21, 2013
2 parents 2794b07 + 7d3cbfd commit 5102fde
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fsnotify_bsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,12 @@ func (w *Watcher) removeWatch(path string) error {
watchEntry := &w.kbuf[0]
syscall.SetKevent(watchEntry, watchfd, syscall.EVFILT_VNODE, syscall.EV_DELETE)
success, errno := syscall.Kevent(w.kq, w.kbuf[:], nil, nil)
w.bufmut.Unlock()
if success == -1 {
return os.NewSyscallError("kevent_rm_watch", errno)
} else if (watchEntry.Flags & syscall.EV_ERROR) == syscall.EV_ERROR {
return errors.New("kevent rm error")
}
w.bufmut.Unlock()
syscall.Close(watchfd)
w.wmut.Lock()
delete(w.watches, path)
Expand Down

0 comments on commit 5102fde

Please sign in to comment.