1
zj
2025-04-17 ff2d1f5acdadc466d7e199028ef385ae8ca277e7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package kernel.util;
 
public class ThreadUtils {
    
    private static ThreadLocal<?> localVar;
 
    @SuppressWarnings("unchecked")
    public static <T> T getThreadLocal() {
        if (localVar == null) {
            localVar = new ThreadLocal<T>();
        }
        return (T) localVar;
    }
 
    public static void sleep(long millis) {
        try {
            Thread.sleep(millis);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
 
}