public class ThreadUtils extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
ThreadUtils.MainThreadOverride |
Modifier and Type | Field and Description |
---|---|
static int |
OVERRIDE_DISABLED |
static int |
OVERRIDE_MAIN_THREAD_FALSE |
static int |
OVERRIDE_MAIN_THREAD_TRUE |
Modifier and Type | Method and Description |
---|---|
static void |
assertDoesntHoldLock(Object lock) |
static void |
assertHoldsLock(Object lock) |
static void |
assertMainThread() |
static boolean |
isMainThread() |
static void |
setMainThreadOverride(int override) |
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 final int OVERRIDE_DISABLED
public static final int OVERRIDE_MAIN_THREAD_TRUE
public static final int OVERRIDE_MAIN_THREAD_FALSE
public static void setMainThreadOverride(int override)
public static boolean isMainThread()
public static void assertMainThread()
public static void assertHoldsLock(Object lock)
public static void assertDoesntHoldLock(Object lock)
public static int tryInheritThreadPriorityFromCurrentThread(int threadId)
public static int tryRaiseThreadPriority(int threadId, int targetThreadPriority)