Skip to content

Commit 3439dd8

Browse files
davidmotenzsxwing
authored andcommitted
ensure waiting tasks are cancelled on worker unsubscription (#3867)
1 parent 8af2bc9 commit 3439dd8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/main/java/rx/schedulers/ExecutorScheduler.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,17 @@ public void run() {
100100
queue.clear();
101101
return;
102102
}
103-
104103
ScheduledAction sa = queue.poll();
105104
if (sa == null) {
106105
return;
107106
}
108-
109107
if (!sa.isUnsubscribed()) {
110-
sa.run();
108+
if (!tasks.isUnsubscribed()) {
109+
sa.run();
110+
} else {
111+
queue.clear();
112+
return;
113+
}
111114
}
112115
} while (wip.decrementAndGet() != 0);
113116
}

0 commit comments

Comments
 (0)