ThreadUtils

tee3.webrtc

## 类 ThreadUtils

- java.lang.Object
- - tee3.webrtc.ThreadUtils

-     public class ThreadUtils
      extends java.lang.Object

- - ### 嵌套类概要

    嵌套类
    限定符和类型 | 类和说明
    --- | ---
    `static interface` | `ThreadUtils.BlockingOperation` Utility interface to be used with executeUninterruptibly() to wait for blocking operations to complete without getting interrupted..
    `static class` | `ThreadUtils.ThreadChecker` Utility class to be used for checking that a method is called on the correct thread.

  - ### 构造器概要

    构造器
    构造器和说明
    `ThreadUtils()`

  - ### 方法概要

    所有方法 静态方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `static void` | `awaitUninterruptibly(java.util.concurrent.CountDownLatch latch)`
    `static boolean` | `awaitUninterruptibly(java.util.concurrent.CountDownLatch barrier, long timeoutMs)`
    `static void` | `checkIsOnMainThread()` Throws exception if called from other than main thread.
    `static void` | `executeUninterruptibly(ThreadUtils.BlockingOperation operation)` Utility method to make sure a blocking operation is executed to completion without getting interrupted.
    `static <V> V` | `invokeAtFrontUninterruptibly(android.os.Handler handler, java.util.concurrent.Callable<V> callable)` Post |callable| to |handler| and wait for the result.
    `static void` | `invokeAtFrontUninterruptibly(android.os.Handler handler, java.lang.Runnable runner)` Post |runner| to |handler|, at the front, and wait for completion.
    `static void` | `joinUninterruptibly(java.lang.Thread thread)`
    `static boolean` | `joinUninterruptibly(java.lang.Thread thread, long timeoutMs)`

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### ThreadUtils

          public ThreadUtils()

  - ### 方法详细资料

    - #### checkIsOnMainThread

          public static void checkIsOnMainThread()

      Throws exception if called from other than main thread.

    - #### 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(java.lang.Thread thread,
                                                    long timeoutMs)

    - #### joinUninterruptibly

          public static void joinUninterruptibly(java.lang.Thread thread)

    - #### awaitUninterruptibly

          public static void awaitUninterruptibly(java.util.concurrent.CountDownLatch latch)

    - #### awaitUninterruptibly

          public static boolean awaitUninterruptibly(java.util.concurrent.CountDownLatch barrier,
                                                     long timeoutMs)

    - #### invokeAtFrontUninterruptibly

          public static <V> V invokeAtFrontUninterruptibly(android.os.Handler handler,
                                                           java.util.concurrent.Callable<V> callable)

      Post |callable| to |handler| and wait for the result.

    - #### invokeAtFrontUninterruptibly

          public static void invokeAtFrontUninterruptibly(android.os.Handler handler,
                                                          java.lang.Runnable runner)

      Post |runner| to |handler|, at the front, and wait for completion.