From d85cf074f2186dbe1cf8a9db5d89a2b817ffb0e1 Mon Sep 17 00:00:00 2001 From: "jam@chromium.org" <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> Date: Tue, 27 Oct 2009 03:59:31 +0000 Subject: Simplify threading in browser thread by making only ChromeThread deal with different thread lifetimes.The rest of the code doesn't get MessageLoop pointers since they're not thread-safe and instead just call PostTask on ChromeThread. If the target thread is not alive, then the task is simply deleted.In a followup change, I'll remove any remaining MessageLoop* caching. With this change, there's little to be gained by caching since no locks are involved if the target MessageLoop is guaranteed to outlive the current thread (inferred automatically by the order of the chrome_threads_ array).BUG=25354 Review URL: http://codereview.chromium.org/306032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30163 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/process_singleton_linux.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'chrome/browser/process_singleton_linux.cc') diff --git a/chrome/browser/process_singleton_linux.cc b/chrome/browser/process_singleton_linux.cc index 0268693..af2a519 100644 --- a/chrome/browser/process_singleton_linux.cc +++ b/chrome/browser/process_singleton_linux.cc @@ -466,8 +466,7 @@ void ProcessSingleton::LinuxWatcher::OnFileCanReadWithoutBlocking(int fd) { } void ProcessSingleton::LinuxWatcher::StartListening(int socket) { - DCHECK(ChromeThread::GetMessageLoop(ChromeThread::IO) == - MessageLoop::current()); + DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); // Watch for client connections on this socket. MessageLoopForIO* ml = MessageLoopForIO::current(); ml->AddDestructionObserver(this); -- cgit v1.1