Skip to content

Commit

Permalink
Fix MonoProcessor#block duration.zero change
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane Maldini committed May 7, 2019
1 parent 2992d21 commit c995c01
Showing 1 changed file with 6 additions and 7 deletions.
Expand Up @@ -178,13 +178,6 @@ public O block(@Nullable Duration timeout) {
delay = System.nanoTime() + timeout.toNanos();
}
for (; ; ) {
if (timeout != null && delay < System.nanoTime()) {
cancel();
throw new IllegalStateException("Timeout on Mono blocking read");
}

Thread.sleep(1);

NextInner<O>[] inners = subscribers;
if (inners == TERMINATED) {
if (error != null) {
Expand All @@ -197,6 +190,12 @@ public O block(@Nullable Duration timeout) {
}
return value;
}
if (timeout != null && delay < System.nanoTime()) {
cancel();
throw new IllegalStateException("Timeout on Mono blocking read");
}

Thread.sleep(1);
}

}
Expand Down

0 comments on commit c995c01

Please sign in to comment.