ThreadTestUtil
@UnstableApi
public final class ThreadTestUtil
Static utility to coordinate threads in testing environments.
Summary
Public methods |
|
|---|---|
static void |
registerThreadIsBlockedUntilProgressOnLooper(Registers that the current thread will be blocked with the provided |
static void |
Unblocks any threads that are waiting for progress on the current |
Public methods
registerThreadIsBlockedUntilProgressOnLooper
public static void 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.
| Parameters | |
|---|---|
ConditionVariable conditionVariable |
The |
Looper looper |
The |
unblockThreadsWaitingForProgressOnCurrentLooper
public static void unblockThreadsWaitingForProgressOnCurrentLooper()
Unblocks any threads that are waiting for progress on the current Looper thread.