提交 6eb7afff 编写于 作者: J Jake Wharton

Remove volatile modifier from synchronized field.

上级 b1ea7bad
...@@ -20,6 +20,7 @@ import java.util.concurrent.CountDownLatch; ...@@ -20,6 +20,7 @@ import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import javax.annotation.concurrent.GuardedBy;
import okhttp3.Request; import okhttp3.Request;
import retrofit2.Call; import retrofit2.Call;
import retrofit2.Callback; import retrofit2.Callback;
...@@ -34,7 +35,8 @@ final class BehaviorCall<T> implements Call<T> { ...@@ -34,7 +35,8 @@ final class BehaviorCall<T> implements Call<T> {
private volatile Future<?> task; private volatile Future<?> task;
volatile boolean canceled; volatile boolean canceled;
private volatile boolean executed; @GuardedBy("this")
private boolean executed;
BehaviorCall(NetworkBehavior behavior, ExecutorService backgroundExecutor, Call<T> delegate) { BehaviorCall(NetworkBehavior behavior, ExecutorService backgroundExecutor, Call<T> delegate) {
this.behavior = behavior; this.behavior = behavior;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册