1 /*
2  * Copyright (C) 2014 The Android Open Source Project
3  * Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * This code is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 only, as
8  * published by the Free Software Foundation.  Oracle designates this
9  * particular file as subject to the "Classpath" exception as provided
10  * by Oracle in the LICENSE file that accompanied this code.
11  *
12  * This code is distributed in the hope that it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
15  * version 2 for more details (a copy is included in the LICENSE file that
16  * accompanied this code).
17  *
18  * You should have received a copy of the GNU General Public License version
19  * 2 along with this work; if not, write to the Free Software Foundation,
20  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
21  *
22  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
23  * or visit www.oracle.com if you need additional information or have any
24  * questions.
25  */
26 
27 
28 package java.lang;
29 
30 import java.security.AccessControlContext;
31 import java.security.AccessController;
32 import java.util.Map;
33 import java.util.concurrent.locks.LockSupport;
34 import java.lang.ref.Reference;
35 import java.lang.ref.WeakReference;
36 
37 @SuppressWarnings({"unchecked", "deprecation", "all"})
38 public class Thread implements java.lang.Runnable {
39 
Thread()40 public Thread() { throw new RuntimeException("Stub!"); }
41 
Thread(java.lang.Runnable target)42 public Thread(java.lang.Runnable target) { throw new RuntimeException("Stub!"); }
43 
Thread(java.lang.ThreadGroup group, java.lang.Runnable target)44 public Thread(java.lang.ThreadGroup group, java.lang.Runnable target) { throw new RuntimeException("Stub!"); }
45 
Thread(java.lang.String name)46 public Thread(java.lang.String name) { throw new RuntimeException("Stub!"); }
47 
Thread(java.lang.ThreadGroup group, java.lang.String name)48 public Thread(java.lang.ThreadGroup group, java.lang.String name) { throw new RuntimeException("Stub!"); }
49 
Thread(java.lang.Runnable target, java.lang.String name)50 public Thread(java.lang.Runnable target, java.lang.String name) { throw new RuntimeException("Stub!"); }
51 
Thread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name)52 public Thread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name) { throw new RuntimeException("Stub!"); }
53 
Thread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name, long stackSize)54 public Thread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name, long stackSize) { throw new RuntimeException("Stub!"); }
55 
currentThread()56 public static native java.lang.Thread currentThread();
57 
yield()58 public static native void yield();
59 
sleep(long millis)60 public static void sleep(long millis) throws java.lang.InterruptedException { throw new RuntimeException("Stub!"); }
61 
sleep(long millis, int nanos)62 public static void sleep(long millis, int nanos) throws java.lang.InterruptedException { throw new RuntimeException("Stub!"); }
63 
clone()64 protected java.lang.Object clone() throws java.lang.CloneNotSupportedException { throw new RuntimeException("Stub!"); }
65 
start()66 public synchronized void start() { throw new RuntimeException("Stub!"); }
67 
run()68 public void run() { throw new RuntimeException("Stub!"); }
69 
70 @Deprecated
stop()71 public final void stop() { throw new RuntimeException("Stub!"); }
72 
73 @Deprecated
stop(java.lang.Throwable obj)74 public final synchronized void stop(java.lang.Throwable obj) { throw new RuntimeException("Stub!"); }
75 
interrupt()76 public void interrupt() { throw new RuntimeException("Stub!"); }
77 
interrupted()78 public static native boolean interrupted();
79 
isInterrupted()80 public native boolean isInterrupted();
81 
82 @Deprecated
destroy()83 public void destroy() { throw new RuntimeException("Stub!"); }
84 
isAlive()85 public final boolean isAlive() { throw new RuntimeException("Stub!"); }
86 
87 @Deprecated
suspend()88 public final void suspend() { throw new RuntimeException("Stub!"); }
89 
90 @Deprecated
resume()91 public final void resume() { throw new RuntimeException("Stub!"); }
92 
setPriority(int newPriority)93 public final void setPriority(int newPriority) { throw new RuntimeException("Stub!"); }
94 
getPriority()95 public final int getPriority() { throw new RuntimeException("Stub!"); }
96 
setName(java.lang.String name)97 public final synchronized void setName(java.lang.String name) { throw new RuntimeException("Stub!"); }
98 
getName()99 public final java.lang.String getName() { throw new RuntimeException("Stub!"); }
100 
getThreadGroup()101 public final java.lang.ThreadGroup getThreadGroup() { throw new RuntimeException("Stub!"); }
102 
activeCount()103 public static int activeCount() { throw new RuntimeException("Stub!"); }
104 
enumerate(java.lang.Thread[] tarray)105 public static int enumerate(java.lang.Thread[] tarray) { throw new RuntimeException("Stub!"); }
106 
107 @Deprecated
countStackFrames()108 public int countStackFrames() { throw new RuntimeException("Stub!"); }
109 
join(long millis)110 public final void join(long millis) throws java.lang.InterruptedException { throw new RuntimeException("Stub!"); }
111 
join(long millis, int nanos)112 public final void join(long millis, int nanos) throws java.lang.InterruptedException { throw new RuntimeException("Stub!"); }
113 
join()114 public final void join() throws java.lang.InterruptedException { throw new RuntimeException("Stub!"); }
115 
dumpStack()116 public static void dumpStack() { throw new RuntimeException("Stub!"); }
117 
setDaemon(boolean on)118 public final void setDaemon(boolean on) { throw new RuntimeException("Stub!"); }
119 
isDaemon()120 public final boolean isDaemon() { throw new RuntimeException("Stub!"); }
121 
checkAccess()122 public final void checkAccess() { throw new RuntimeException("Stub!"); }
123 
toString()124 public java.lang.String toString() { throw new RuntimeException("Stub!"); }
125 
getContextClassLoader()126 public java.lang.ClassLoader getContextClassLoader() { throw new RuntimeException("Stub!"); }
127 
setContextClassLoader(java.lang.ClassLoader cl)128 public void setContextClassLoader(java.lang.ClassLoader cl) { throw new RuntimeException("Stub!"); }
129 
holdsLock(java.lang.Object obj)130 public static native boolean holdsLock(java.lang.Object obj);
131 
getStackTrace()132 public java.lang.StackTraceElement[] getStackTrace() { throw new RuntimeException("Stub!"); }
133 
getAllStackTraces()134 public static java.util.Map<java.lang.Thread,java.lang.StackTraceElement[]> getAllStackTraces() { throw new RuntimeException("Stub!"); }
135 
getId()136 public long getId() { throw new RuntimeException("Stub!"); }
137 
getState()138 public java.lang.Thread.State getState() { throw new RuntimeException("Stub!"); }
139 
setDefaultUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler eh)140 public static void setDefaultUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler eh) { throw new RuntimeException("Stub!"); }
141 
getDefaultUncaughtExceptionHandler()142 public static java.lang.Thread.UncaughtExceptionHandler getDefaultUncaughtExceptionHandler() { throw new RuntimeException("Stub!"); }
143 
144 @libcore.api.CorePlatformApi
setUncaughtExceptionPreHandler(UncaughtExceptionHandler eh)145 public static void setUncaughtExceptionPreHandler(UncaughtExceptionHandler eh) { throw new RuntimeException("Stub!"); }
146 
147 @libcore.api.CorePlatformApi
getUncaughtExceptionPreHandler()148 public static UncaughtExceptionHandler getUncaughtExceptionPreHandler() { throw new RuntimeException("Stub!"); }
149 
getUncaughtExceptionHandler()150 public java.lang.Thread.UncaughtExceptionHandler getUncaughtExceptionHandler() { throw new RuntimeException("Stub!"); }
151 
setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler eh)152 public void setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler eh) { throw new RuntimeException("Stub!"); }
153 
154 public static final int MAX_PRIORITY = 10; // 0xa
155 
156 public static final int MIN_PRIORITY = 1; // 0x1
157 
158 public static final int NORM_PRIORITY = 5; // 0x5
159 @SuppressWarnings({"unchecked", "deprecation", "all"})
160 public static enum State {
161 NEW,
162 RUNNABLE,
163 BLOCKED,
164 WAITING,
165 TIMED_WAITING,
166 TERMINATED;
167 }
168 
169 @SuppressWarnings({"unchecked", "deprecation", "all"})
170 @java.lang.FunctionalInterface
171 public static interface UncaughtExceptionHandler {
172 
uncaughtException(java.lang.Thread t, java.lang.Throwable e)173 public void uncaughtException(java.lang.Thread t, java.lang.Throwable e);
174 }
175 
176 }
177 
178