Package org.webrtc
Class ThreadUtils
java.lang.Object
org.webrtc.ThreadUtils
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Utility interface to be used with executeUninterruptibly() to wait for blocking operations to complete without getting interrupted..static class
Utility class to be used for checking that a method is called on the correct thread. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
static boolean
awaitUninterruptibly
(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 void
Utility method to make sure a blocking operation is executed to completion without getting interrupted.static void
joinUninterruptibly
(Thread thread) static boolean
joinUninterruptibly
(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.
-