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 |
static void |
Unblocks any threads that are waiting for progress on the specified |
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.
unblockThreadsWaitingForProgressOnLooper
public static void unblockThreadsWaitingForProgressOnLooper(Looper looper)
Unblocks any threads that are waiting for progress on the specified Looper thread.