ThreadUtils

open class ThreadUtils

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
Utility interface to be used with executeUninterruptibly() to wait for blocking operations to complete without getting interrupted..
Link copied to clipboard
open class ThreadChecker
Utility class to be used for checking that a method is called on the correct thread.

Functions

Link copied to clipboard
open fun awaitUninterruptibly(barrier: CountDownLatch, timeoutMs: Long): Boolean
Link copied to clipboard
Throws exception if called from other than main thread.
Link copied to clipboard
Utility method to make sure a blocking operation is executed to completion without getting interrupted.
Link copied to clipboard
open fun invokeAtFrontUninterruptibly(handler: Handler, runner: Runnable)
Post `runner` to `handler`, at the front, and wait for completion.
open fun <V> invokeAtFrontUninterruptibly(handler: Handler, callable: Callable<V>): V
Post `callable` to `handler` and wait for the result.
Link copied to clipboard
open fun joinUninterruptibly(thread: Thread)
open fun joinUninterruptibly(thread: Thread, timeoutMs: Long): Boolean