From d256e6b2991b8d2ba0a613242d545856540f9540 Mon Sep 17 00:00:00 2001 From: "zork@chromium.org" Date: Tue, 24 Nov 2009 19:08:15 +0000 Subject: Update Signal Thread to use ref counting and locks to ensure thread safety. Review URL: http://codereview.chromium.org/418042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32948 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/sync/notifier/base/signal_thread_task.h | 3 ++- chrome/browser/sync/notifier/listener/mediator_thread_impl.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'chrome/browser/sync') diff --git a/chrome/browser/sync/notifier/base/signal_thread_task.h b/chrome/browser/sync/notifier/base/signal_thread_task.h index ebee005..82853a3 100644 --- a/chrome/browser/sync/notifier/base/signal_thread_task.h +++ b/chrome/browser/sync/notifier/base/signal_thread_task.h @@ -77,7 +77,8 @@ class SignalThreadTask : public talk_base::Task, void ClearSignalThread() { if (signal_thread_) { - signal_thread_->Destroy(); + // Don't wait on the thread destruction, or we may deadlock. + signal_thread_->Destroy(false); signal_thread_ = NULL; } } diff --git a/chrome/browser/sync/notifier/listener/mediator_thread_impl.cc b/chrome/browser/sync/notifier/listener/mediator_thread_impl.cc index 62d44c0..d688b7e 100644 --- a/chrome/browser/sync/notifier/listener/mediator_thread_impl.cc +++ b/chrome/browser/sync/notifier/listener/mediator_thread_impl.cc @@ -68,7 +68,7 @@ void MediatorThreadImpl::Run() { pump_->WakeTasks(); } MessageLoop::current()->RunAllPending(); - } while (!IsStopping()); + } while (!IsQuitting()); #if defined(OS_WIN) set_socketserver(old_socket_server); -- cgit v1.1