Skip to content

Commit 28ec4c7

Browse files
committed
Don't block the action on the queue lock.
1 parent 05bf628 commit 28ec4c7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

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

0 commit comments

Comments
 (0)