Commit 9861e685 authored by tim@chromium.org's avatar tim@chromium.org

sync: annotate call to join SyncCoreThread to keep ThreadRestrictions happy.

Bug 19757 discusses how we block the UI thread on the core thread when shutting
down sync. Until that is fixed, we have to fess up to the Thread police.

BUG=69570,19757
TEST=Start syncing in debug build.  Stop sync.  Don't crash.

Review URL: http://codereview.chromium.org/6328001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71361 0039d316-1c4b-4281-b951-d872f2087c98
parent a8f02439
......@@ -9,6 +9,7 @@
#include "base/command_line.h"
#include "base/file_util.h"
#include "base/task.h"
#include "base/threading/thread_restrictions.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_thread.h"
#include "chrome/browser/net/gaia/token_service.h"
......@@ -240,10 +241,14 @@ void SyncBackendHost::Shutdown(bool sync_disabled) {
// thread (ui loop) can exit before DoShutdown finishes, at which point
// virtually anything the sync backend does (or the post-back to
// frontend_loop_ by our Core) will epically fail because the CRT won't be
// initialized. For now this only ever happens at sync-enabled-Chrome exit,
// meaning bug 1482548 applies to prolonged "waiting" that may occur in
// DoShutdown.
core_thread_.Stop();
// initialized.
// Since we are blocking the UI thread here, we need to turn ourselves in
// with the ThreadRestriction police. For sentencing and how we plan to fix
// this, see bug 19757.
{
base::ThreadRestrictions::ScopedAllowIO allow_io;
core_thread_.Stop();
}
registrar_.routing_info.clear();
registrar_.workers[GROUP_DB] = NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment