Class ThreadUtils


  • public final class ThreadUtils
    extends Object
    Thread utilities.
    Author:
    aherscu
    • Method Detail

      • join

        public static void join​(Thread thread,
                                int timeoutMs)
        Safe alternative to Thread.join().
        Parameters:
        thread - the thread to join
        timeoutMs - timeout in milliseconds
      • sleep

        public static void sleep​(long millis)
        Safe alternative to Thread.sleep(long)
        Parameters:
        millis - how many milliseconds to sleep