From 3baebc3b65f670293c01e9935c7d13770ca89c21 Mon Sep 17 00:00:00 2001 From: "shess@chromium.org" Date: Mon, 20 Dec 2010 18:34:07 +0000 Subject: [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 --- chrome/browser/file_path_watcher/file_path_watcher_mac.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- cgit v1.1