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

Fix deadlock on BSD #77

Merged
merged 1 commit into from
Nov 21, 2013
Merged

Fix deadlock on BSD #77

merged 1 commit into from
Nov 21, 2013

Conversation

cespare
Copy link
Contributor

@cespare cespare commented Nov 21, 2013

I'm using fsnotify for a project where I set up recursive watches using the usual directory walking song and dance. I noticed that on Mac OS fsnotify would quickly get into a bad state where I'd stop receiving any events.

It turned out that fsnotify was deadlocking because mutexes weren't always properly released.

The removeWatch routine could return without releasing the lock on w.bufmut. This change unlocks the mutex before checking for errors.

The removeWatch routine could return without releasing the lock on
w.bufmut. This change unlocks the mutex before checking for errors.
howeyc added a commit that referenced this pull request Nov 21, 2013
@howeyc howeyc merged commit 5102fde into howeyc:master Nov 21, 2013
@howeyc
Copy link
Owner

howeyc commented Nov 21, 2013

Thanks!

rsc pushed a commit to golang/exp that referenced this pull request Dec 7, 2014
Handle ERROR_MORE_DATA on Windows
(howeyc/fsnotify#49)

Run tests in random temp directories
(howeyc/fsnotify#57)

Fix: RemoveWatch is not removing the path from the watch list
The issue was that files watched internally were not being removed
when the parent directory's watch was removed.
(howeyc/fsnotify#71)

Fix: Race on OS X between Close() and readEvents()
(howeyc/fsnotify#70)

Fix: deadlock on BSD
The removeWatch routine could return without releasing the lock on
w.bufmut. This change unlocks the mutex before checking for errors.
(howeyc/fsnotify#77)

Add an IsAttrib method on the FileEvent struct
(howeyc/fsnotify#79)

Fix: a few typos

Test helpers for shared setup.

LGTM=iant
R=golang-codereviews, dave, alex.brainman, gobot, bradfitz, iant
CC=bradfitz, bronze1man, cespare, denis.brandolini, golang-codereviews, henrik.edwards, jbowtie, travis.cline, webustany
https://golang.org/cl/58500043
GoogleCodeExporter pushed a commit to bsed/go-zh.exp that referenced this pull request May 31, 2015
Handle ERROR_MORE_DATA on Windows
(howeyc/fsnotify#49)

Run tests in random temp directories
(howeyc/fsnotify#57)

Fix: RemoveWatch is not removing the path from the watch list
The issue was that files watched internally were not being removed
when the parent directory's watch was removed.
(howeyc/fsnotify#71)

Fix: Race on OS X between Close() and readEvents()
(howeyc/fsnotify#70)

Fix: deadlock on BSD
The removeWatch routine could return without releasing the lock on
w.bufmut. This change unlocks the mutex before checking for errors.
(howeyc/fsnotify#77)

Add an IsAttrib method on the FileEvent struct
(howeyc/fsnotify#79)

Fix: a few typos

Test helpers for shared setup.

LGTM=iant
R=golang-codereviews, dave, alex.brainman, gobot, bradfitz, iant
CC=bradfitz, bronze1man, cespare, denis.brandolini, golang-codereviews, henrik.edwards, jbowtie, travis.cline, webustany
https://codereview.appspot.com/58500043

Committer: Ian Lance Taylor <iant@golang.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants