Package org.webrtc

Class ThreadUtils

java.lang.Object
org.webrtc.ThreadUtils

public class ThreadUtils extends Object
  • Constructor Details

    • ThreadUtils

      public ThreadUtils()
  • Method Details

    • executeUninterruptibly

      public static void executeUninterruptibly(ThreadUtils.BlockingOperation operation)
      Utility method to make sure a blocking operation is executed to completion without getting interrupted. This should be used in cases where the operation is waiting for some critical work, e.g. cleanup, that must complete before returning. If the thread is interrupted during the blocking operation, this function will re-run the operation until completion, and only then re-interrupt the thread.
    • joinUninterruptibly

      public static boolean joinUninterruptibly(Thread thread, long timeoutMs)
    • joinUninterruptibly

      public static void joinUninterruptibly(Thread thread)
    • awaitUninterruptibly

      public static void awaitUninterruptibly(CountDownLatch latch)
    • awaitUninterruptibly

      public static boolean awaitUninterruptibly(CountDownLatch barrier, long timeoutMs)
    • concatStackTraces

      static StackTraceElement[] concatStackTraces(StackTraceElement[] inner, StackTraceElement[] outer)
      Post `runner` to `handler`, at the front, and wait for completion.