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(@ibcore.util.Nullable java.lang.Runnable target)42 public Thread(@libcore.util.Nullable java.lang.Runnable target) { throw new RuntimeException("Stub!"); }
43
Thread(@ibcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.Nullable java.lang.Runnable target)44 public Thread(@libcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.Nullable java.lang.Runnable target) { throw new RuntimeException("Stub!"); }
45
Thread(@ibcore.util.NonNull java.lang.String name)46 public Thread(@libcore.util.NonNull java.lang.String name) { throw new RuntimeException("Stub!"); }
47
Thread(@ibcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.NonNull java.lang.String name)48 public Thread(@libcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.NonNull java.lang.String name) { throw new RuntimeException("Stub!"); }
49
Thread(@ibcore.util.Nullable java.lang.Runnable target, @libcore.util.NonNull java.lang.String name)50 public Thread(@libcore.util.Nullable java.lang.Runnable target, @libcore.util.NonNull java.lang.String name) { throw new RuntimeException("Stub!"); }
51
Thread(@ibcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.Nullable java.lang.Runnable target, @libcore.util.NonNull java.lang.String name)52 public Thread(@libcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.Nullable java.lang.Runnable target, @libcore.util.NonNull java.lang.String name) { throw new RuntimeException("Stub!"); }
53
Thread(@ibcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.Nullable java.lang.Runnable target, @libcore.util.NonNull java.lang.String name, long stackSize)54 public Thread(@libcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.Nullable java.lang.Runnable target, @libcore.util.NonNull java.lang.String name, long stackSize) { throw new RuntimeException("Stub!"); }
55
Thread(@ibcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.Nullable java.lang.Runnable target, @libcore.util.NonNull java.lang.String name, long stackSize, boolean inheritThreadLocals)56 public Thread(@libcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.Nullable java.lang.Runnable target, @libcore.util.NonNull java.lang.String name, long stackSize, boolean inheritThreadLocals) { throw new RuntimeException("Stub!"); }
57
currentThread()58 @libcore.util.NonNull public static native java.lang.Thread currentThread();
59
yield()60 public static native void yield();
61
sleep(long millis)62 public static void sleep(long millis) throws java.lang.InterruptedException { throw new RuntimeException("Stub!"); }
63
sleep(long millis, int nanos)64 public static void sleep(long millis, int nanos) throws java.lang.InterruptedException { throw new RuntimeException("Stub!"); }
65
clone()66 @libcore.util.NonNull protected java.lang.Object clone() throws java.lang.CloneNotSupportedException { throw new RuntimeException("Stub!"); }
67
start()68 public synchronized void start() { throw new RuntimeException("Stub!"); }
69
run()70 public void run() { throw new RuntimeException("Stub!"); }
71
stop()72 @Deprecated public final void stop() { throw new RuntimeException("Stub!"); }
73
stop(@ibcore.util.Nullable java.lang.Throwable obj)74 @Deprecated public final synchronized void stop(@libcore.util.Nullable 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
destroy()82 @Deprecated public void destroy() { throw new RuntimeException("Stub!"); }
83
isAlive()84 public final boolean isAlive() { throw new RuntimeException("Stub!"); }
85
suspend()86 @Deprecated public final void suspend() { throw new RuntimeException("Stub!"); }
87
resume()88 @Deprecated public final void resume() { throw new RuntimeException("Stub!"); }
89
setPriority(int newPriority)90 public final void setPriority(int newPriority) { throw new RuntimeException("Stub!"); }
91
getPriority()92 public final int getPriority() { throw new RuntimeException("Stub!"); }
93
setName(@ibcore.util.NonNull java.lang.String name)94 public final synchronized void setName(@libcore.util.NonNull java.lang.String name) { throw new RuntimeException("Stub!"); }
95
getName()96 @libcore.util.NonNull public final java.lang.String getName() { throw new RuntimeException("Stub!"); }
97
getThreadGroup()98 @libcore.util.Nullable public final java.lang.ThreadGroup getThreadGroup() { throw new RuntimeException("Stub!"); }
99
activeCount()100 public static int activeCount() { throw new RuntimeException("Stub!"); }
101
enumerate(java.lang.Thread[] tarray)102 public static int enumerate(java.lang.Thread[] tarray) { throw new RuntimeException("Stub!"); }
103
countStackFrames()104 @Deprecated public int countStackFrames() { throw new RuntimeException("Stub!"); }
105
join(long millis)106 public final void join(long millis) throws java.lang.InterruptedException { throw new RuntimeException("Stub!"); }
107
join(long millis, int nanos)108 public final void join(long millis, int nanos) throws java.lang.InterruptedException { throw new RuntimeException("Stub!"); }
109
join()110 public final void join() throws java.lang.InterruptedException { throw new RuntimeException("Stub!"); }
111
dumpStack()112 public static void dumpStack() { throw new RuntimeException("Stub!"); }
113
setDaemon(boolean on)114 public final void setDaemon(boolean on) { throw new RuntimeException("Stub!"); }
115
isDaemon()116 public final boolean isDaemon() { throw new RuntimeException("Stub!"); }
117
checkAccess()118 public final void checkAccess() { throw new RuntimeException("Stub!"); }
119
toString()120 @libcore.util.NonNull public java.lang.String toString() { throw new RuntimeException("Stub!"); }
121
getContextClassLoader()122 @libcore.util.Nullable public java.lang.ClassLoader getContextClassLoader() { throw new RuntimeException("Stub!"); }
123
setContextClassLoader(@ibcore.util.Nullable java.lang.ClassLoader cl)124 public void setContextClassLoader(@libcore.util.Nullable java.lang.ClassLoader cl) { throw new RuntimeException("Stub!"); }
125
holdsLock(@ibcore.util.NonNull java.lang.Object obj)126 public static native boolean holdsLock(@libcore.util.NonNull java.lang.Object obj);
127
getStackTrace()128 public java.lang.@libcore.util.NonNull StackTraceElement @libcore.util.NonNull [] getStackTrace() { throw new RuntimeException("Stub!"); }
129
getAllStackTraces()130 @libcore.util.NonNull public static java.util.Map<@libcore.util.NonNull java.lang.Thread,java.lang.@libcore.util.NonNull StackTraceElement @libcore.util.NonNull []> getAllStackTraces() { throw new RuntimeException("Stub!"); }
131
getId()132 public long getId() { throw new RuntimeException("Stub!"); }
133
getState()134 @libcore.util.NonNull public java.lang.Thread.State getState() { throw new RuntimeException("Stub!"); }
135
setDefaultUncaughtExceptionHandler(@ibcore.util.Nullable java.lang.Thread.UncaughtExceptionHandler eh)136 public static void setDefaultUncaughtExceptionHandler(@libcore.util.Nullable java.lang.Thread.UncaughtExceptionHandler eh) { throw new RuntimeException("Stub!"); }
137
getDefaultUncaughtExceptionHandler()138 @libcore.util.Nullable public static java.lang.Thread.UncaughtExceptionHandler getDefaultUncaughtExceptionHandler() { throw new RuntimeException("Stub!"); }
139
getUncaughtExceptionHandler()140 @libcore.util.Nullable public java.lang.Thread.UncaughtExceptionHandler getUncaughtExceptionHandler() { throw new RuntimeException("Stub!"); }
141
setUncaughtExceptionHandler(@ibcore.util.Nullable java.lang.Thread.UncaughtExceptionHandler eh)142 public void setUncaughtExceptionHandler(@libcore.util.Nullable java.lang.Thread.UncaughtExceptionHandler eh) { throw new RuntimeException("Stub!"); }
143
144 public static final int MAX_PRIORITY = 10; // 0xa
145
146 public static final int MIN_PRIORITY = 1; // 0x1
147
148 public static final int NORM_PRIORITY = 5; // 0x5
149 @SuppressWarnings({"unchecked", "deprecation", "all"})
150 public static enum State {
151 NEW,
152 RUNNABLE,
153 BLOCKED,
154 WAITING,
155 TIMED_WAITING,
156 TERMINATED;
157 }
158
159 @SuppressWarnings({"unchecked", "deprecation", "all"})
160 @java.lang.FunctionalInterface
161 public static interface UncaughtExceptionHandler {
162
uncaughtException(@ibcore.util.NonNull java.lang.Thread t, @libcore.util.NonNull java.lang.Throwable e)163 public void uncaughtException(@libcore.util.NonNull java.lang.Thread t, @libcore.util.NonNull java.lang.Throwable e);
164 }
165
166 }
167