1 /*
2 * Copyright (C) 2014 The Android Open Source Project
3 * Copyright (c) 1994, 2019, 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 @SuppressWarnings({"unchecked", "deprecation", "all"})
31 public class Thread implements java.lang.Runnable {
32
Thread()33 public Thread() { throw new RuntimeException("Stub!"); }
34
Thread(java.lang.Runnable target)35 public Thread(java.lang.Runnable target) { throw new RuntimeException("Stub!"); }
36
Thread(java.lang.Runnable target, java.lang.String name)37 public Thread(java.lang.Runnable target, java.lang.String name) { throw new RuntimeException("Stub!"); }
38
Thread(java.lang.String name)39 public Thread(java.lang.String name) { throw new RuntimeException("Stub!"); }
40
Thread(java.lang.ThreadGroup group, java.lang.Runnable target)41 public Thread(java.lang.ThreadGroup group, java.lang.Runnable target) { throw new RuntimeException("Stub!"); }
42
Thread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name)43 public Thread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name) { throw new RuntimeException("Stub!"); }
44
Thread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name, long stackSize)45 public Thread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name, long stackSize) { throw new RuntimeException("Stub!"); }
46
Thread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name, long stackSize, boolean inheritThreadLocals)47 public Thread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name, long stackSize, boolean inheritThreadLocals) { throw new RuntimeException("Stub!"); }
48
Thread(java.lang.ThreadGroup group, java.lang.String name)49 public Thread(java.lang.ThreadGroup group, java.lang.String name) { throw new RuntimeException("Stub!"); }
50
activeCount()51 public static int activeCount() { throw new RuntimeException("Stub!"); }
52
53 @android.annotation.FlaggedApi(com.android.libcore.Flags.FLAG_OPENJDK_21_V1_APIS)
54 @Deprecated
checkAccess()55 public final void checkAccess() { throw new RuntimeException("Stub!"); }
56
clone()57 protected java.lang.Object clone() throws java.lang.CloneNotSupportedException { throw new RuntimeException("Stub!"); }
58
59 @Deprecated
countStackFrames()60 public int countStackFrames() { throw new RuntimeException("Stub!"); }
61
currentThread()62 public static native java.lang.Thread currentThread();
63
64 @Deprecated
destroy()65 public void destroy() { throw new RuntimeException("Stub!"); }
66
dumpStack()67 public static void dumpStack() { throw new RuntimeException("Stub!"); }
68
enumerate(java.lang.Thread[] tarray)69 public static int enumerate(java.lang.Thread[] tarray) { throw new RuntimeException("Stub!"); }
70
getAllStackTraces()71 public static java.util.Map<java.lang.Thread,java.lang.StackTraceElement[]> getAllStackTraces() { throw new RuntimeException("Stub!"); }
72
getContextClassLoader()73 public java.lang.ClassLoader getContextClassLoader() { throw new RuntimeException("Stub!"); }
74
getDefaultUncaughtExceptionHandler()75 public static java.lang.Thread.UncaughtExceptionHandler getDefaultUncaughtExceptionHandler() { throw new RuntimeException("Stub!"); }
76
77 @android.annotation.FlaggedApi(com.android.libcore.Flags.FLAG_OPENJDK_21_V1_APIS)
78 @Deprecated
getId()79 public long getId() { throw new RuntimeException("Stub!"); }
80
getName()81 public final java.lang.String getName() { throw new RuntimeException("Stub!"); }
82
getPriority()83 public final int getPriority() { throw new RuntimeException("Stub!"); }
84
getStackTrace()85 public java.lang.StackTraceElement[] getStackTrace() { throw new RuntimeException("Stub!"); }
86
getState()87 public java.lang.Thread.State getState() { throw new RuntimeException("Stub!"); }
88
getThreadGroup()89 public final java.lang.ThreadGroup getThreadGroup() { throw new RuntimeException("Stub!"); }
90
getUncaughtExceptionHandler()91 public java.lang.Thread.UncaughtExceptionHandler getUncaughtExceptionHandler() { throw new RuntimeException("Stub!"); }
92
holdsLock(java.lang.Object obj)93 public static native boolean holdsLock(java.lang.Object obj);
94
interrupt()95 public void interrupt() { throw new RuntimeException("Stub!"); }
96
interrupted()97 public static native boolean interrupted();
98
isAlive()99 public final boolean isAlive() { throw new RuntimeException("Stub!"); }
100
isDaemon()101 public final boolean isDaemon() { throw new RuntimeException("Stub!"); }
102
isInterrupted()103 public native boolean isInterrupted();
104
105 @android.annotation.FlaggedApi(com.android.libcore.Flags.FLAG_OPENJDK_21_V1_APIS)
isVirtual()106 public final boolean isVirtual() { throw new RuntimeException("Stub!"); }
107
join()108 public final void join() throws java.lang.InterruptedException { 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
onSpinWait()114 public static void onSpinWait() { throw new RuntimeException("Stub!"); }
115
116 @Deprecated
resume()117 public final void resume() { throw new RuntimeException("Stub!"); }
118
run()119 public void run() { throw new RuntimeException("Stub!"); }
120
setContextClassLoader(java.lang.ClassLoader cl)121 public void setContextClassLoader(java.lang.ClassLoader cl) { throw new RuntimeException("Stub!"); }
122
setDaemon(boolean on)123 public final void setDaemon(boolean on) { throw new RuntimeException("Stub!"); }
124
setDefaultUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler eh)125 public static void setDefaultUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler eh) { throw new RuntimeException("Stub!"); }
126
setName(java.lang.String name)127 public final synchronized void setName(java.lang.String name) { throw new RuntimeException("Stub!"); }
128
setPriority(int newPriority)129 public final void setPriority(int newPriority) { throw new RuntimeException("Stub!"); }
130
setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler eh)131 public void setUncaughtExceptionHandler(java.lang.Thread.UncaughtExceptionHandler eh) { throw new RuntimeException("Stub!"); }
132
sleep(long millis)133 public static void sleep(long millis) throws java.lang.InterruptedException { throw new RuntimeException("Stub!"); }
134
sleep(long millis, int nanos)135 public static void sleep(long millis, int nanos) throws java.lang.InterruptedException { throw new RuntimeException("Stub!"); }
136
start()137 public synchronized void start() { throw new RuntimeException("Stub!"); }
138
139 @Deprecated
stop()140 public final void stop() { throw new RuntimeException("Stub!"); }
141
142 @Deprecated
stop(java.lang.Throwable obj)143 public final synchronized void stop(java.lang.Throwable obj) { throw new RuntimeException("Stub!"); }
144
145 @Deprecated
suspend()146 public final void suspend() { throw new RuntimeException("Stub!"); }
147
148 @android.annotation.FlaggedApi(com.android.libcore.Flags.FLAG_OPENJDK_21_V1_APIS)
threadId()149 public final long threadId() { throw new RuntimeException("Stub!"); }
150
toString()151 public java.lang.String toString() { throw new RuntimeException("Stub!"); }
152
yield()153 public static native void yield();
154
155 public static final int MAX_PRIORITY = 10; // 0xa
156
157 public static final int MIN_PRIORITY = 1; // 0x1
158
159 public static final int NORM_PRIORITY = 5; // 0x5
160 @SuppressWarnings({"unchecked", "deprecation", "all"})
161 public enum State {
162 BLOCKED,
163 NEW,
164 RUNNABLE,
165 TERMINATED,
166 TIMED_WAITING,
167 WAITING;
168 }
169
170 @SuppressWarnings({"unchecked", "deprecation", "all"})
171 @java.lang.FunctionalInterface
172 public static interface UncaughtExceptionHandler {
173
uncaughtException(java.lang.Thread t, java.lang.Throwable e)174 public void uncaughtException(java.lang.Thread t, java.lang.Throwable e);
175 }
176
177 }
178
179