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