public final class TcThreads extends Object
Thread and ThreadLocal.| Modifier and Type | Method and Description |
|---|---|
static boolean |
join(Thread thread) |
static <T> T |
set(ThreadLocal<T> threadLocal,
T value)
Sets the value of a
ThreadLocal and return the previous value. |
static <T> T |
set(ThreadLocal<T> threadLocal,
T value,
T defaultValue)
Sets the value of a
ThreadLocal and return the previous value, or
the specified default value if null. |
static boolean |
sleep(long duration,
TimeUnit timeUnit) |
public static boolean sleep(long duration,
TimeUnit timeUnit)
public static boolean join(Thread thread)
public static <T> T set(ThreadLocal<T> threadLocal, T value)
ThreadLocal and return the previous value.public static <T> T set(ThreadLocal<T> threadLocal, T value, T defaultValue)
ThreadLocal and return the previous value, or
the specified default value if null.Copyright © 2009-2012 TranceCode. All Rights Reserved.