From 38ff64c545086bedae3976397fa1ca70cd7c7f77 Mon Sep 17 00:00:00 2001 From: Tomasz Bialek Date: Thu, 31 Oct 2024 09:40:22 -0500 Subject: [PATCH] Moved all non-WIP stuff to ThreadTools --- src/main/java/us/ihmc/commons/thread/ThreadTools.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/us/ihmc/commons/thread/ThreadTools.java b/src/main/java/us/ihmc/commons/thread/ThreadTools.java index 07abaa9..ee2700d 100644 --- a/src/main/java/us/ihmc/commons/thread/ThreadTools.java +++ b/src/main/java/us/ihmc/commons/thread/ThreadTools.java @@ -128,10 +128,14 @@ public static void sleepForever() } /** - * Very similar to {@link #sleepSeconds(double)}, but uses {@link LockSupport#parkNanos} to sleep. + * Similar to {@link #sleepSeconds(double)}, but uses {@link LockSupport#parkNanos} to sleep. * {@link LockSupport#parkNanos} is more accurate than {@link Thread#sleep}. * The requested sleep is guaranteed to be at least as long as the requested * amount and can be up to a nanosecond longer. + *

+ * Also, while {@link #sleepSeconds(double)} swallows interrupts, + * this method will return upon being interrupted + * and the calling thread's interrupt status will be preserved. */ public static void park(double seconds) {