зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1041082 - Don't perform double-checked locking in GeckoInputConnection; r=rnewman
This commit is contained in:
Родитель
9e51ca16d9
Коммит
9e9c77463b
|
@ -517,7 +517,8 @@ class GeckoInputConnection
|
|||
GeckoInputConnection.class.notify();
|
||||
}
|
||||
Looper.loop();
|
||||
sBackgroundHandler = null;
|
||||
// We should never be exiting the thread loop.
|
||||
throw new IllegalThreadStateException("unreachable code");
|
||||
}
|
||||
}, LOGTAG);
|
||||
backgroundThread.setDaemon(true);
|
||||
|
@ -562,11 +563,7 @@ class GeckoInputConnection
|
|||
if (!canReturnCustomHandler()) {
|
||||
return defHandler;
|
||||
}
|
||||
// getBackgroundHandler() is synchronized and requires locking,
|
||||
// but if we already have our handler, we don't have to lock
|
||||
final Handler newHandler = sBackgroundHandler != null
|
||||
? sBackgroundHandler
|
||||
: getBackgroundHandler();
|
||||
final Handler newHandler = getBackgroundHandler();
|
||||
if (mEditableClient.setInputConnectionHandler(newHandler)) {
|
||||
return newHandler;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче