1 public class Thread implements Runnable {
3 private boolean finished;
5 private boolean daemon;
8 final ThreadLocalMap locals;
14 threadId = Thread.id++;
15 locals = new ThreadLocalMap();
23 public Thread(Runnable r) {
27 threadId = Thread.id++;
28 locals = new ThreadLocalMap();
31 public Thread(Runnable r, String n)
37 threadId = Thread.id++;
38 locals = new ThreadLocalMap();
45 private static void staticStart(Thread t) {
50 public static native void yield();
56 private native void nativeJoin();
58 public native static void sleep(long millis);
67 private native void nativeCreate();
69 public final boolean isAlive() {
70 return !this.finished;
73 public static ThreadLocalMap getThreadLocals() {
74 return currentThread().locals;
77 public final synchronized void setDaemon(boolean daemon) {
78 /*if (vmThread != null)
79 throw new IllegalThreadStateException();
84 public native static Thread currentThread();
86 /*public static Map getAllStackTraces() {
87 System.out.println("Unimplemented Thread.getAllStackTraces()");