reschke commented on code in PR #2705:
URL: https://github.com/apache/jackrabbit-oak/pull/2705#discussion_r2736511333
##########
oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/internal/concurrent/UninterruptibleUtils.java:
##########
@@ -64,4 +65,49 @@ public static void awaitUninterruptibly(CountDownLatch
latch) {
}
}
}
+
+ /**
+ * Causes the current thread to sleep for the specified duration,
+ * ignoring {@link InterruptedException} until the full sleep time
+ * has elapsed, then restores the interrupted status before returning.
+ * <p>
+ * This behaves like Guava's
+ * {@code Uninterruptibles.sleepUninterruptibly(long, TimeUnit)}:
+ * it repeatedly invokes {@link TimeUnit#sleep(long)} until the
+ * requested time has passed, catching and recording interruptions
+ * and recomputing the remaining time from a fixed deadline.
+ *
+ * @param sleep the time to sleep; must be non-negative
+ * @param unit the time unit of the {@code sleep} argument; must not
be {@code null}
+ * @throws NullPointerException if {@code unit} is {@code null}
+ * @throws IllegalArgumentException if {@code sleep} is negative
+ */
Review Comment:
This could use `Duration` instead.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]