Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing defer in windows.go@WatchList #446

Closed
Sojamann opened this issue Apr 22, 2022 · 1 comment
Closed

Missing defer in windows.go@WatchList #446

Sojamann opened this issue Apr 22, 2022 · 1 comment

Comments

@Sojamann
Copy link
Contributor

Sojamann commented Apr 22, 2022

Location
windows.go line 103 of ref 8fa037f (current HEAD) introduced in ceba4ef

Problem
The mutex is unlocked right after locking it. It seems like somebody forgot to put it there. Both kqueue.go and inotify.go perform a defer.

func (w *Watcher) WatchList() []string {
   w.mu.Lock()
   w.mu.Unlock()
   // ....
}

Should be

func (w *Watcher) WatchList() []string {
   w.mu.Lock()
   defer w.mu.Unlock()
   // ....
}
@shogo82148
Copy link
Member

fixed by #447

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants