rishabhdaim commented on code in PR #2711:
URL: https://github.com/apache/jackrabbit-oak/pull/2711#discussion_r2741622082
##########
oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/internal/concurrent/UninterruptibleUtils.java:
##########
@@ -110,4 +110,39 @@ public static void sleepUninterruptibly(final long sleep,
final TimeUnit unit) {
}
}
}
+
+ /**
+ * Invokes {@link TimeUnit#timedJoin(Thread, long)} uninterruptibly.
+ * <p>
+ * This method repeatedly calls {@link TimeUnit#timedJoin(Thread, long)}
until the
+ * specified timeout has elapsed or the target thread terminates, ignoring
+ * {@link InterruptedException} but remembering that an interruption
+ * occurred. When the method finally returns, it restores the current
+ * thread's interrupted status if any interruptions were detected.
+ *
+ * @param toJoin the thread to wait for; must not be {@code null}
+ * @throws NullPointerException if {@code toJoin} or {@code unit} is
{@code null}
+ * @throws IllegalArgumentException if {@code timeout} is negative
+ */
+ public static void joinUninterruptibly(final Thread toJoin) {
+
+ Objects.requireNonNull(toJoin, "thread to join is null");
+
+ boolean interrupted = false;
+
+ try {
+ for(;;) {
Review Comment:
They are same, even at the machine code level.
--
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]