We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9897ca8 commit d7bd826Copy full SHA for d7bd826
rxjava-core/src/main/java/rx/subscriptions/SerialSubscription.java
@@ -38,16 +38,7 @@ public void unsubscribe() {
38
39
@Override
40
public void unsubscribe() {
41
- do {
42
- final Subscription current = reference.get();
43
- if (current == UNSUBSCRIBED) {
44
- break;
45
- }
46
- if (reference.compareAndSet(current, UNSUBSCRIBED)) {
47
- current.unsubscribe();
48
49
50
- } while (true);
+ setSubscription(UNSUBSCRIBED);
51
}
52
53
public void setSubscription(final Subscription subscription) {
@@ -63,8 +54,4 @@ public void setSubscription(final Subscription subscription) {
63
54
64
55
} while (true);
65
56
66
-
67
- public Subscription getSubscription() {
68
- return reference.get();
69
70
57
0 commit comments