/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This source file is part of SableVM classlib-stubs. * * * * See the file "LICENSE" for the copyright information and for * * the terms and conditions for copying, distribution and * * modification of this source file. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package java.lang; import java.util.Map; import org.sablevm.annotations.ImplementedInVM; public class Thread extends Object implements Runnable { public static final int MIN_PRIORITY = 1; public static final int NORM_PRIORITY = 5; public static final int MAX_PRIORITY = 10; public Thread() { } public Thread(Runnable target) { } public Thread(ThreadGroup group, Runnable target) { } public Thread(String name) { } public Thread(ThreadGroup group, String name) { } public Thread(Runnable target, String name) { } public Thread(ThreadGroup group, Runnable target, String name) { } public Thread(ThreadGroup group, Runnable target, String name, long stackSize) { } @ImplementedInVM native public static Thread currentThread(); @ImplementedInVM native public static void yield(); @ImplementedInVM native public static void sleep(long millis) throws InterruptedException; @ImplementedInVM native public static void sleep(long millis, int nanos) throws InterruptedException; @ImplementedInVM native public void start(); @ImplementedInVM native public void run(); @Deprecated @ImplementedInVM native public final void stop(); @Deprecated @ImplementedInVM native public final void stop(Throwable obj); @ImplementedInVM native public void interrupt(); @ImplementedInVM native public static boolean interrupted(); @ImplementedInVM native public boolean isInterrupted(); @Deprecated @ImplementedInVM native public void destroy(); @ImplementedInVM native public final boolean isAlive(); @Deprecated @ImplementedInVM native public final void suspend(); @Deprecated @ImplementedInVM native public final void resume(); @ImplementedInVM native public final void setPriority(int newPriority); @ImplementedInVM native public final int getPriority(); @ImplementedInVM native public final void setName(String name); @ImplementedInVM native public final String getName(); @ImplementedInVM native public final ThreadGroup getThreadGroup(); @ImplementedInVM native public static int activeCount(); @ImplementedInVM native public static int enumerate(Thread[] tarray); @Deprecated @ImplementedInVM native public int countStackFrames(); @ImplementedInVM native public final void join(long millis) throws InterruptedException; @ImplementedInVM native public final void join(long millis, int nanos) throws InterruptedException; @ImplementedInVM native public final void join() throws InterruptedException; @ImplementedInVM native public static void dumpStack(); @ImplementedInVM native public final void setDaemon(boolean on); @ImplementedInVM native public final boolean isDaemon(); @ImplementedInVM native public final void checkAccess(); @ImplementedInVM native public String toString(); @ImplementedInVM native public ClassLoader getContextClassLoader(); @ImplementedInVM native public void setContextClassLoader(ClassLoader cl); @ImplementedInVM native public static boolean holdsLock(Object obj); @ImplementedInVM native public StackTraceElement[] getStackTrace(); @ImplementedInVM native public static Map getAllStackTraces(); @ImplementedInVM native public long getId(); @ImplementedInVM native public Thread.State getState(); @ImplementedInVM native public static void setDefaultUncaughtExceptionHandler( Thread.UncaughtExceptionHandler eh); @ImplementedInVM native public static Thread.UncaughtExceptionHandler getDefaultUncaughtExceptionHandler(); @ImplementedInVM native public Thread.UncaughtExceptionHandler getUncaughtExceptionHandler(); @ImplementedInVM native public void setUncaughtExceptionHandler( Thread.UncaughtExceptionHandler eh); public static enum State { NEW, RUNNABLE, BLOCKED, WAITING, TIMED_WAITING, TERMINATED } public static interface UncaughtExceptionHandler { void uncaughtException(Thread t, Throwable e); } }