@UnstableApi
class ThreadTestUtil


Static utility to coordinate threads in testing environments.

Summary

Public functions

java-static Unit
registerThreadIsBlockedUntilProgressOnLooper(
    conditionVariable: ConditionVariable!,
    looper: Looper!
)

Registers that the current thread will be blocked with the provided ConditionVariable until the specified Looper reports to have made progress via unblockThreadsWaitingForProgressOnCurrentLooper.

java-static Unit

Unblocks any threads that are waiting for progress on the current Looper thread.

Public functions

registerThreadIsBlockedUntilProgressOnLooper

java-static fun registerThreadIsBlockedUntilProgressOnLooper(
    conditionVariable: ConditionVariable!,
    looper: Looper!
): Unit

Registers that the current thread will be blocked with the provided ConditionVariable until the specified Looper reports to have made progress via unblockThreadsWaitingForProgressOnCurrentLooper.

Parameters
conditionVariable: ConditionVariable!

The ConditionVariable that will block the current thread.

looper: Looper!

The Looper that must report progress to unblock the current thread. Must not be the Looper of the current thread.

unblockThreadsWaitingForProgressOnCurrentLooper

java-static fun unblockThreadsWaitingForProgressOnCurrentLooper(): Unit

Unblocks any threads that are waiting for progress on the current Looper thread.