Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(921)

Unified Diff: content/browser/browser_thread_impl.cc

Issue 10900020: Fix regression in BrowserThread's optimization of when it skips a lock. The variable name was misna… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_thread_impl.cc
===================================================================
--- content/browser/browser_thread_impl.cc (revision 153862)
+++ content/browser/browser_thread_impl.cc (working copy)
@@ -238,12 +238,12 @@
// which would require a lock because std::map isn't thread safe, defeating
// the whole purpose of this optimization.
BrowserThread::ID current_thread;
- bool guaranteed_to_outlive_target_thread =
+ bool target_thread_outlives_current =
GetCurrentThreadIdentifier(&current_thread) &&
- current_thread <= identifier;
+ current_thread >= identifier;
BrowserThreadGlobals& globals = g_globals.Get();
- if (!guaranteed_to_outlive_target_thread)
+ if (!target_thread_outlives_current)
globals.lock.Acquire();
MessageLoop* message_loop = globals.threads[identifier] ?
@@ -256,7 +256,7 @@
}
}
- if (!guaranteed_to_outlive_target_thread)
+ if (!target_thread_outlives_current)
globals.lock.Release();
return !!message_loop;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698