commit | 18dd476b0c93b4d0666cc7d2d130a6065b5fea6d | [log] [tgz] |
---|---|---|
author | TreeHugger Robot <treehugger-gerrit@google.com> | Mon Mar 16 22:58:11 2020 +0000 |
committer | Android (Google) Code Review <android-gerrit@google.com> | Mon Mar 16 22:58:11 2020 +0000 |
tree | 67bfa5a9645adb9f578972f84865cfdb71dfb2b4 | |
parent | 583092c980bcf777049afb32ee620563e96af200 [diff] | |
parent | 4d93b189a9c33bb07a62d8d134357965744ff817 [diff] |
Merge "Attempt to fix race condition in PooledLambdaImpl." into rvc-dev
diff --git a/core/java/com/android/internal/util/function/pooled/PooledLambdaImpl.java b/core/java/com/android/internal/util/function/pooled/PooledLambdaImpl.java index 8446bbd..e4a4408 100755 --- a/core/java/com/android/internal/util/function/pooled/PooledLambdaImpl.java +++ b/core/java/com/android/internal/util/function/pooled/PooledLambdaImpl.java
@@ -200,8 +200,9 @@ try { return doInvoke(); } finally { - if (isRecycleOnUse()) doRecycle(); - if (!isRecycled()) { + if (isRecycleOnUse()) { + doRecycle(); + } else if (!isRecycled()) { int argsSize = ArrayUtils.size(mArgs); for (int i = 0; i < argsSize; i++) { popArg(i);