java.lang.*中Thread 原始碼詳解

曾衛 發表於 2020-10-16

java.lang.*中Thread 原始碼詳解

學習Java的同學注意了!!!
學習過程中遇到什麼問題或者想獲取學習資源的話,歡迎加入Java學習交流群,群號碼:543120397 我們一起學Java!

核心方法

public class Thread implements Runnable {

native Thread currentThread()
native void yield()
native void sleep(long millis)
void sleep(long millis, int nanos)
public Thread() 建構函式
public Thread(Runnable target)
public Thread(String name)
synchronized void start()
void run()
void stop()
void interrupt()
boolean interrupted()
void setPriority(int newPriority)
int getPriority()
synchronized void setName(String name)
final String getName()
ThreadGroup getThreadGroup()
int activeCount()
int enumerate(Thread tarray[])
synchronized void join(long millis)
void dumpStack()
void setDaemon(boolean on)
final boolean isDaemon()
final void checkAccess()
String toString()
ClassLoader getContextClassLoader()
void setContextClassLoader(ClassLoader cl)
StackTraceElement[] getStackTrace()
enum State
State getState()