Fix thread-shared field evades lock acquisition reported by Coverity

Change-Id: Ia351e2ddc79a3f8e1b47ed1e697a2d24b2a3ebe7
This commit is contained in:
Xu Qian
2021-03-22 12:55:25 +08:00
committed by Jia Jia
parent efbd8b3961
commit 2d33d70352

View File

@@ -1196,13 +1196,11 @@ public class Typeface {
/** @hide */
public boolean isSupportedAxes(int axis) {
if (mSupportedAxes == null) {
synchronized (this) {
synchronized (this) {
if (mSupportedAxes == null) {
mSupportedAxes = nativeGetSupportedAxes(native_instance);
if (mSupportedAxes == null) {
mSupportedAxes = nativeGetSupportedAxes(native_instance);
if (mSupportedAxes == null) {
mSupportedAxes = EMPTY_AXES;
}
mSupportedAxes = EMPTY_AXES;
}
}
}