summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_process_impl.cc
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-10 22:24:53 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-12-10 22:24:53 +0000
commita40e548394014c8679c269fb936a57e68e632080 (patch)
tree9ecab63f54ba8ce7be569da87b2d364f48dca391 /chrome/browser/browser_process_impl.cc
parentaebe23a3cd89181c929618093ec8a0fefb4b4f11 (diff)
downloadchromium_src-a40e548394014c8679c269fb936a57e68e632080.zip
chromium_src-a40e548394014c8679c269fb936a57e68e632080.tar.gz
chromium_src-a40e548394014c8679c269fb936a57e68e632080.tar.bz2
Consider PlatformThread::Join() to be blocking IO.
Marks PlatformThread::Join() as blocking IO using ThreadRestrictions. Whitelists existing spots where we join on the UI/IO threads. Also noteworthy is I allow blocking IO on shutdown. BUG=65530,66077,66082 TEST=none Review URL: http://codereview.chromium.org/5693003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68893 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r--chrome/browser/browser_process_impl.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index ea52797..8facb15 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -13,6 +13,7 @@
#include "base/path_service.h"
#include "base/task.h"
#include "base/thread.h"
+#include "base/thread_restrictions.h"
#include "base/waitable_event.h"
#include "chrome/browser/appcache/chrome_appcache_service.h"
#include "chrome/browser/automation/automation_provider_list.h"
@@ -252,6 +253,12 @@ unsigned int BrowserProcessImpl::ReleaseModule() {
DCHECK_NE(0u, module_ref_count_);
module_ref_count_--;
if (0 == module_ref_count_) {
+ // Allow UI and IO threads to do blocking IO on shutdown, since we do a lot
+ // of it on shutdown for valid reasons.
+ base::ThreadRestrictions::SetIOAllowed(true);
+ io_thread()->message_loop()->PostTask(
+ FROM_HERE,
+ NewRunnableFunction(&base::ThreadRestrictions::SetIOAllowed, true));
MessageLoop::current()->PostTask(
FROM_HERE, NewRunnableFunction(DidEndMainMessageLoop));
MessageLoop::current()->Quit();