summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-20 18:34:07 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-20 18:34:07 +0000
commit3baebc3b65f670293c01e9935c7d13770ca89c21 (patch)
treeeb9b78cfa43f126cfd7e5f1331d122700bac8f6a
parent6ea69540b4f3f45a125bb5e704cda62840471991 (diff)
downloadchromium_src-3baebc3b65f670293c01e9935c7d13770ca89c21.zip
chromium_src-3baebc3b65f670293c01e9935c7d13770ca89c21.tar.gz
chromium_src-3baebc3b65f670293c01e9935c7d13770ca89c21.tar.bz2
[Mac] Work around FSEventStreamInvalidate() bug.
The way FilePathWatcherImpl on OSX uses FSEventStream caused a double-close of a file descriptor. If another thread allocated a file descriptor during that window, it would later have problems. This mostly happened on browser_tests, but it could also happen in the real world. The change uses a more specific function to remove the stream from the runloop. BUG=66938 TEST=waterfall Review URL: http://codereview.chromium.org/6048002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69727 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/file_path_watcher/file_path_watcher_mac.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/chrome/browser/file_path_watcher/file_path_watcher_mac.cc b/chrome/browser/file_path_watcher/file_path_watcher_mac.cc
index 0b28ccd..86c5bb58 100644
--- a/chrome/browser/file_path_watcher/file_path_watcher_mac.cc
+++ b/chrome/browser/file_path_watcher/file_path_watcher_mac.cc
@@ -220,7 +220,8 @@ void FilePathWatcherImpl::UpdateEventStream(FSEventStreamEventId start_event) {
void FilePathWatcherImpl::DestroyEventStream() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
FSEventStreamStop(fsevent_stream_);
- FSEventStreamInvalidate(fsevent_stream_);
+ FSEventStreamUnscheduleFromRunLoop(fsevent_stream_, CFRunLoopGetCurrent(),
+ kCFRunLoopDefaultMode);
FSEventStreamRelease(fsevent_stream_);
fsevent_stream_ = NULL;
}