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

Unified Diff: content/public/android/java/src/org/chromium/content/app/LibraryLoader.java

Issue 11312066: Android: uses an object rather than the Boolean for synchronizing LibraryLoad. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits Created 8 years, 1 month 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 | « build/android/findbugs_filter/findbugs_known_bugs.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/java/src/org/chromium/content/app/LibraryLoader.java
diff --git a/content/public/android/java/src/org/chromium/content/app/LibraryLoader.java b/content/public/android/java/src/org/chromium/content/app/LibraryLoader.java
index 2ce2281b3e7c286665cfdf244219743426ec6526..ee0379347f41b53b7099d0065053bb89af1607dd 100644
--- a/content/public/android/java/src/org/chromium/content/app/LibraryLoader.java
+++ b/content/public/android/java/src/org/chromium/content/app/LibraryLoader.java
@@ -29,7 +29,8 @@ public class LibraryLoader {
private static String sLibrary = null;
- // This object's lock guards its assignment and also the library load.
+ // This object's lock guards sLoaded assignment and also the library load.
+ private static Object sLoadedLock = new Object();
private static Boolean sLoaded = false;
private static boolean sInitialized = false;
@@ -109,10 +110,10 @@ public class LibraryLoader {
// Already initialized.
return;
}
- synchronized(LibraryLoader.class) {
+ synchronized (sLoadedLock) {
try {
while (!sLoaded) {
- LibraryLoader.class.wait();
+ sLoadedLock.wait();
}
// If the UI thread blocked waiting for the task it will already
// have handled the library load completion, so don't duplicate that work here.
@@ -196,7 +197,7 @@ public class LibraryLoader {
if (sLibrary == null) {
assert false : "No library specified to load. Call setLibraryToLoad before first.";
}
- synchronized(sLoaded) {
+ synchronized (sLoadedLock) {
if (!sLoaded) {
assert !sInitialized;
Log.i(TAG, "loading: " + sLibrary);
« no previous file with comments | « build/android/findbugs_filter/findbugs_known_bugs.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698