Package org.webrtc
Class ThreadUtils
java.lang.Object
org.webrtc.ThreadUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceUtility interface to be used with executeUninterruptibly() to wait for blocking operations to complete without getting interrupted..static classUtility class to be used for checking that a method is called on the correct thread. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic booleanawaitUninterruptibly(CountDownLatch barrier, long timeoutMs) (package private) static StackTraceElement[]concatStackTraces(StackTraceElement[] inner, StackTraceElement[] outer) Post `runner` to `handler`, at the front, and wait for completion.static voidUtility method to make sure a blocking operation is executed to completion without getting interrupted.static voidjoinUninterruptibly(Thread thread) static booleanjoinUninterruptibly(Thread thread, long timeoutMs)
-
Constructor Details
-
ThreadUtils
public ThreadUtils()
-
-
Method Details
-
executeUninterruptibly
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
-
joinUninterruptibly
-
awaitUninterruptibly
-
awaitUninterruptibly
-
concatStackTraces
Post `runner` to `handler`, at the front, and wait for completion.
-