Skip to content

2.x: Switch a SerialResource use to SerialDisposable. #4101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import io.reactivex.*;
import io.reactivex.disposables.*;
import io.reactivex.exceptions.MissingBackpressureException;
import io.reactivex.internal.disposables.SerialResource;
import io.reactivex.internal.queue.SpscArrayQueue;
import io.reactivex.internal.subscriptions.SubscriptionHelper;
import io.reactivex.plugins.RxJavaPlugins;
Expand All @@ -47,7 +46,7 @@ static final class CompletableConcatSubscriber
private static final long serialVersionUID = 7412667182931235013L;
final CompletableSubscriber actual;
final int prefetch;
final SerialResource<Disposable> sr;
final SerialDisposable sd;

final SpscArrayQueue<CompletableConsumable> queue;

Expand All @@ -63,7 +62,7 @@ public CompletableConcatSubscriber(CompletableSubscriber actual, int prefetch) {
this.actual = actual;
this.prefetch = prefetch;
this.queue = new SpscArrayQueue<CompletableConsumable>(prefetch);
this.sr = new SerialResource<Disposable>(Disposables.consumeAndDispose());
this.sd = new SerialDisposable();
this.inner = new ConcatInnerSubscriber();
}

Expand Down Expand Up @@ -125,7 +124,7 @@ void innerComplete() {
@Override
public void dispose() {
s.cancel();
sr.dispose();
sd.dispose();
}

void next() {
Expand All @@ -148,7 +147,7 @@ void next() {
final class ConcatInnerSubscriber implements CompletableSubscriber {
@Override
public void onSubscribe(Disposable d) {
sr.set(d);
sd.set(d);
}

@Override
Expand Down