Skip to content

Commit 05bf628

Browse files
committed
Merge branch 'fix1702' of https://github.com/jnlopar/RxJava into fix1702
2 parents 412828d + 6db3afc commit 05bf628

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/java/rx/schedulers/TrampolineScheduler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ private Subscription enqueue(Action0 action, long execTime) {
7979
do {
8080
TimedAction polled;
8181
synchronized (queue) {
82-
polled = queue.poll();
83-
}
84-
if (polled != null) {
85-
polled.action.call();
82+
if (!queue.isEmpty()) {
83+
TimedAction polled = queue.poll();
84+
polled.action.call();
85+
}
8686
}
8787
} while (wip.decrementAndGet() > 0);
8888
return Subscriptions.unsubscribed();

0 commit comments

Comments
 (0)