public final class ThreadUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
assertMainThread() |
static void |
assertMainThread(java.lang.String message) |
static <T> T |
getResultInheritingPriority(java.util.concurrent.Future<T> future,
int runningThreadId) |
static boolean |
isMainThread() |
static void |
postOnUiThread(java.lang.Runnable runnable) |
static void |
runOnBackgroundThread(java.lang.Runnable runnable) |
static void |
runOnUiThread(java.lang.Runnable runnable) |
static int |
tryInheritThreadPriorityFromCurrentThread(int threadId)
Try to raise the priority of to the priority of the calling thread
|
static int |
tryRaiseThreadPriority(int threadId,
int targetThreadPriority)
Try to raise the priority of to .
|
public static void assertMainThread()
public static void assertMainThread(java.lang.String message)
public static boolean isMainThread()
public static <T> T getResultInheritingPriority(java.util.concurrent.Future<T> future, int runningThreadId)
public static int tryInheritThreadPriorityFromCurrentThread(int threadId)
public static int tryRaiseThreadPriority(int threadId, int targetThreadPriority)
public static void runOnUiThread(java.lang.Runnable runnable)
public static void postOnUiThread(java.lang.Runnable runnable)
public static void runOnBackgroundThread(java.lang.Runnable runnable)