Home
last modified time | relevance | path

Searched refs:Thread (Results 1 – 25 of 412) sorted by relevance

12345678910>>...17

/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DThreadTest.java20 import java.lang.Thread.UncaughtExceptionHandler;
63 Thread parent;
75 Thread.sleep(100); in run()
82 Thread.sleep(500); in run()
86 while (!Thread.currentThread().isInterrupted()) { in run()
89 Thread.sleep(50); in run()
102 public ResSupThread(Thread t) { in ResSupThread()
120 Thread st, ct, spinner;
127 ct = new Thread(new SimpleThread(10)); in test_ConstructorLjava_lang_Runnable()
137 Thread st1 = new Thread(new SimpleThread(1), "SimpleThread1"); in test_ConstructorLjava_lang_RunnableLjava_lang_String()
[all …]
DThreadGroupTest.java27 private Thread.UncaughtExceptionHandler originalThreadDefaultUncaughtExceptionHandler;
31 initialThreadGroup = Thread.currentThread().getThreadGroup(); in setUp()
42 originalThreadDefaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler(); in setUp()
44 Thread.setDefaultUncaughtExceptionHandler(testThreadDefaultUncaughtExceptionHandler); in setUp()
50 Thread.setDefaultUncaughtExceptionHandler(originalThreadDefaultUncaughtExceptionHandler); in tearDown()
80 newGroup.getParent() == Thread.currentThread().getThreadGroup()); in test_ConstructorLjava_lang_ThreadGroupLjava_lang_String()
103 Thread t1 = new Thread(tg, new Runnable() { in test_activeCount()
106 Thread.sleep(5000); in test_activeCount()
181 Thread noOp = new Thread(testRoot, null, "no-op thread") { in test_destroy()
200 noOp = new Thread(testRoot, null, "no-op thread") { in test_destroy()
[all …]
/libcore/luni/src/test/java/libcore/java/lang/
DThreadTest.java30 import java.lang.Thread.UncaughtExceptionHandler;
63 Thread.currentThread().getContextClassLoader()); in javaContextClassLoader()
99 Thread.sleep(millis); in threadSleep()
109 Thread.currentThread().interrupt(); in threadInterrupted()
111 Thread.sleep(0); in threadInterrupted()
114 assertFalse(Thread.currentThread().isInterrupted()); in threadInterrupted()
122 Thread.sleep(-1); in threadSleepIllegalArguments()
128 Thread.sleep(0, -1); in threadSleepIllegalArguments()
134 Thread.sleep(0, 1000000); in threadSleepIllegalArguments()
152 Thread.sleep(1000); in threadWakeup()
[all …]
DOldThreadTest.java52 st = new Thread(tg, new SimpleThread(1), "SimpleThread3", 1); in test_ConstructorLjava_lang_ThreadGroupLjava_lang_RunnableLjava_lang_StringL$L()
63 new Thread(tg, new SimpleThread(1), "SimpleThread3", in test_ConstructorLjava_lang_ThreadGroupLjava_lang_RunnableLjava_lang_StringL$L()
77 Thread.dumpStack(); in test_dumpStack()
91 boolean b = Thread.holdsLock(this); in enterLocked()
96 boolean b = Thread.holdsLock(this); in enterNonLocked()
105 final Thread parker = new Thread() { in test_joinWithSpuriousInterruption()
114 Thread unparker = new Thread() { in test_joinWithSpuriousInterruption()
119 Thread.sleep(100); in test_joinWithSpuriousInterruption()
138 st = new Thread(); in test_setContextClassLoader()
147 st = new Thread(new SimpleThread(5)); in test_setDaemonZ()
[all …]
DOldThreadStateTest.java23 Thread.State [] exStates = { Thread.State.NEW, Thread.State.RUNNABLE,
24 Thread.State.BLOCKED, Thread.State.WAITING,
25 Thread.State.TIMED_WAITING, Thread.State.TERMINATED };
32 assertEquals(exStates[i], Thread.State.valueOf(spNames[i])); in test_valueOfLString()
38 Thread.State.valueOf(s); in test_valueOfLString()
47 Thread.State [] thStates = Thread.State.values(); in test_values()
49 for(Thread.State ts:thStates) { in test_values()
54 boolean isContain(Thread.State state) { in isContain()
55 for(Thread.State ts:exStates) { in isContain()
DOldThreadGroupTest.java27 public class OldThreadGroupTest extends TestCase implements Thread.UncaughtExceptionHandler {
29 class MyThread extends Thread {
42 Thread.sleep(50); in run()
58 Thread.yield(); in isActivelyRunning()
78 Thread t1 = new Thread(tg, new Runnable() { in test_activeGroupCount()
107 Thread[] listOfThreads = new Thread[numThreads]; in test_enumerateLThreadArray()
118 Thread[] initialThreads = new Thread[initialThreadCount]; in test_enumerateLThreadArrayLZtest_enumerateLThreadArrayLZ()
132 Thread.sleep(500); // starting threads isn't instant! in test_enumerateLThreadArrayLZtest_enumerateLThreadArrayLZ()
134 Set<Thread> initialPlusNew = new HashSet<Thread>(); in test_enumerateLThreadArrayLZtest_enumerateLThreadArrayLZ()
137 Thread[] afterStartThreads = new Thread[afterStartCount]; in test_enumerateLThreadArrayLZtest_enumerateLThreadArrayLZ()
[all …]
DThreadGroupTest.java46 Thread first = createHangThread(group); in interrupt_shouldInterruptAllThreadsInAGroup()
47 Thread second = createHangThread(group); in interrupt_shouldInterruptAllThreadsInAGroup()
62 Thread first = createHangThread(parentGroup); in interrupt_shouldInterruptThreadsInSubgroups()
63 Thread second = createHangThread(childGroup); in interrupt_shouldInterruptThreadsInSubgroups()
78 Thread first = createHangThread(parentGroup); in interrupt_shouldNotInterruptThreadsInParentGroup()
79 Thread second = createHangThread(childGroup); in interrupt_shouldNotInterruptThreadsInParentGroup()
95 Thread thread = createHangThread(threadGroup); in suspend_shouldThrowUnsupportedOperationException()
112 Thread thread = createHangThread(threadGroup); in stop_shouldThrowUnsupportedOperationException()
125 private Thread createHangThread(ThreadGroup threadGroup) { in createHangThread()
126 return new Thread(threadGroup, () -> { in createHangThread()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/org/apache/harmony/kernel/dalvik/
DThreadsTest.java54 Thread parkerThread = new Thread(parker); in test_parkFor_1()
55 Thread waiterThread = in test_parkFor_1()
56 new Thread(new WaitAndUnpark(barrier, 1000, parkerThread)); in test_parkFor_1()
69 Thread parkerThread = new Thread(parker); in test_parkFor_2()
70 Thread waiterThread = in test_parkFor_2()
71 new Thread(new WaitAndUnpark(barrier, 300, parkerThread)); in test_parkFor_2()
85 Thread parkerThread = new Thread(parker); in test_parkFor_3()
97 Thread parkerThread = new Thread(parker); in test_parkUntil_1()
98 Thread waiterThread = in test_parkUntil_1()
99 new Thread(new WaitAndUnpark(barrier, 1000, parkerThread)); in test_parkUntil_1()
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/locks/
DLockSupport.java142 private static void setBlocker(Thread t, Object arg) { in setBlocker()
161 U.putReferenceOpaque(Thread.currentThread(), PARKBLOCKER, blocker); in setCurrentBlocker()
175 public static void unpark(Thread thread) { in unpark()
209 Thread t = Thread.currentThread(); in park()
250 Thread t = Thread.currentThread(); in parkNanos()
291 Thread t = Thread.currentThread(); in parkUntil()
309 public static Object getBlocker(Thread t) { in getBlocker()
419 static final long getThreadId(Thread thread) { in getThreadId()
426 = U.objectFieldOffset(Thread.class, "parkBlocker");
428 = U.objectFieldOffset(Thread.class, "tid");
DReentrantLock.java126 Thread current = Thread.currentThread(); in tryLock()
158 if (Thread.interrupted()) in lockInterruptibly()
166 if (Thread.interrupted()) in tryLockNanos()
174 if (getExclusiveOwnerThread() != Thread.currentThread()) in tryRelease()
186 return getExclusiveOwnerThread() == Thread.currentThread(); in isHeldExclusively()
195 final Thread getOwner() { in getOwner()
224 Thread current = Thread.currentThread(); in initialTryLock()
243 setExclusiveOwnerThread(Thread.currentThread()); in tryAcquire()
260 Thread current = Thread.currentThread(); in initialTryLock()
282 setExclusiveOwnerThread(Thread.currentThread()); in tryAcquire()
[all …]
DAbstractQueuedSynchronizer.java457 Thread waiter; // visibly nonnull when enqueued
502 return status <= 1 || Thread.currentThread().isInterrupted(); in isReleasable()
638 Thread current = Thread.currentThread(); in acquire()
662 Thread.onSpinWait(); // ensure serialization in acquire()
708 Thread.onSpinWait(); in acquire()
721 if ((interrupted |= Thread.interrupted()) && interruptible) in acquire()
782 Thread.currentThread().interrupt(); in cancelAcquire()
957 if (Thread.interrupted() || in acquireInterruptibly()
981 if (!Thread.interrupted()) { in tryAcquireNanos()
1045 if (Thread.interrupted() || in acquireSharedInterruptibly()
[all …]
DAbstractQueuedLongSynchronizer.java92 Thread waiter; // visibly nonnull when enqueued
137 return status <= 1 || Thread.currentThread().isInterrupted(); in isReleasable()
273 Thread current = Thread.currentThread(); in acquire()
297 Thread.onSpinWait(); // ensure serialization in acquire()
343 Thread.onSpinWait(); in acquire()
356 if ((interrupted |= Thread.interrupted()) && interruptible) in acquire()
416 Thread.currentThread().interrupt(); in cancelAcquire()
591 if (Thread.interrupted() || in acquireInterruptibly()
615 if (!Thread.interrupted()) { in tryAcquireNanos()
679 if (Thread.interrupted() || in acquireSharedInterruptibly()
[all …]
/libcore/ojluni/src/test/java/util/concurrent/tck/
DThreadTest.java49 static class MyHandler implements Thread.UncaughtExceptionHandler {
50 public void uncaughtException(Thread t, Throwable e) { in uncaughtException()
62 Thread current = Thread.currentThread(); in testGetAndSetUncaughtExceptionHandler()
80 assertEquals(null, Thread.getDefaultUncaughtExceptionHandler()); in testGetAndSetDefaultUncaughtExceptionHandler()
83 Thread.UncaughtExceptionHandler defaultHandler in testGetAndSetDefaultUncaughtExceptionHandler()
84 = Thread.getDefaultUncaughtExceptionHandler(); in testGetAndSetDefaultUncaughtExceptionHandler()
87 Thread.setDefaultUncaughtExceptionHandler(eh); in testGetAndSetDefaultUncaughtExceptionHandler()
89 assertSame(eh, Thread.getDefaultUncaughtExceptionHandler()); in testGetAndSetDefaultUncaughtExceptionHandler()
91 Thread.setDefaultUncaughtExceptionHandler(defaultHandler); in testGetAndSetDefaultUncaughtExceptionHandler()
96 assertSame(defaultHandler, Thread.getDefaultUncaughtExceptionHandler()); in testGetAndSetDefaultUncaughtExceptionHandler()
DPhaserTest.java333 List<Thread> threads = new ArrayList<>(); in testArrive2()
342 for (Thread thread : threads) in testArrive2()
449 Thread t = newStartedThread(new CheckedRunnable() {
488 Thread t1 = newStartedThread(new CheckedRunnable() {
490 Thread.currentThread().interrupt();
495 assertFalse(Thread.interrupted());
502 assertFalse(Thread.interrupted());
505 Thread t2 = newStartedThread(new CheckedRunnable() {
507 Thread.currentThread().interrupt();
512 assertFalse(Thread.interrupted());
[all …]
/libcore/ojluni/src/test/java/awt/font/NumericShaper/
DMTTest.java69 Thread th1 = new Thread(new Work(ns1, expected1)); in main()
70 Thread th2 = new Thread(new Work(ns2, expected2)); in main()
71 Thread th3 = new Thread(new Work(ns1, expected1)); in main()
72 Thread th4 = new Thread(new Work(ns2, expected2)); in main()
73 Thread th5 = new Thread(new Work(ns3, expected1)); in main()
74 Thread th6 = new Thread(new Work(ns4, expected2)); in main()
75 Thread th7 = new Thread(new Work(ns3, expected1)); in main()
76 Thread th8 = new Thread(new Work(ns4, expected2)); in main()
91 Thread.sleep(1000); // 1 seconds in main()
/libcore/jsr166-tests/src/test/java/jsr166/
DThreadTest.java25 static class MyHandler implements Thread.UncaughtExceptionHandler {
26 public void uncaughtException(Thread t, Throwable e) { in uncaughtException()
38 Thread current = Thread.currentThread(); in testGetAndSetUncaughtExceptionHandler()
62 Thread.UncaughtExceptionHandler defaultHandler in testGetAndSetDefaultUncaughtExceptionHandler()
63 = Thread.getDefaultUncaughtExceptionHandler(); in testGetAndSetDefaultUncaughtExceptionHandler()
66 Thread.setDefaultUncaughtExceptionHandler(eh); in testGetAndSetDefaultUncaughtExceptionHandler()
68 assertSame(eh, Thread.getDefaultUncaughtExceptionHandler()); in testGetAndSetDefaultUncaughtExceptionHandler()
70 Thread.setDefaultUncaughtExceptionHandler(defaultHandler); in testGetAndSetDefaultUncaughtExceptionHandler()
75 assertSame(defaultHandler, Thread.getDefaultUncaughtExceptionHandler()); in testGetAndSetDefaultUncaughtExceptionHandler()
DPhaserTest.java309 List<Thread> threads = new ArrayList<Thread>(); in testArrive2()
318 for (Thread thread : threads) in testArrive2()
425 Thread t = newStartedThread(new CheckedRunnable() {
464 Thread t1 = newStartedThread(new CheckedRunnable() {
466 Thread.currentThread().interrupt();
471 assertFalse(Thread.interrupted());
478 assertFalse(Thread.interrupted());
481 Thread t2 = newStartedThread(new CheckedRunnable() {
483 Thread.currentThread().interrupt();
488 assertFalse(Thread.interrupted());
[all …]
/libcore/ojluni/annotations/mmodule/java/lang/
DThread.annotated.java38 public class Thread implements java.lang.Runnable { class
40 public Thread() { throw new RuntimeException("Stub!"); } in Thread() method in Thread
42 public Thread(java.lang.Runnable target) { throw new RuntimeException("Stub!"); } in Thread() method in Thread
44 public Thread(java.lang.ThreadGroup group, java.lang.Runnable target) { throw new RuntimeException(… in Thread() method in Thread
46 public Thread(java.lang.String name) { throw new RuntimeException("Stub!"); } in Thread() method in Thread
48 public Thread(java.lang.ThreadGroup group, java.lang.String name) { throw new RuntimeException("Stu… in Thread() method in Thread
50 public Thread(java.lang.Runnable target, java.lang.String name) { throw new RuntimeException("Stub!… in Thread() method in Thread
52 public Thread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name) { thro… in Thread() method in Thread
54 public Thread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name, long s… in Thread() method in Thread
56 public static native java.lang.Thread currentThread(); in currentThread()
[all …]
/libcore/ojluni/annotations/hiddenapi/java/lang/
DThread.java32 public class Thread implements java.lang.Runnable { class
34 public Thread() { in Thread() method in Thread
38 public Thread(java.lang.Runnable target) { in Thread() method in Thread
42 Thread(java.lang.Runnable target, java.security.AccessControlContext acc) { in Thread() method in Thread
46 public Thread(java.lang.ThreadGroup group, java.lang.Runnable target) { in Thread() method in Thread
50 public Thread(java.lang.String name) { in Thread() method in Thread
54 public Thread(java.lang.ThreadGroup group, java.lang.String name) { in Thread() method in Thread
59 Thread(java.lang.ThreadGroup group, java.lang.String name, int priority, boolean daemon) { in Thread() method in Thread
63 public Thread(java.lang.Runnable target, java.lang.String name) { in Thread() method in Thread
67 public Thread(java.lang.ThreadGroup group, java.lang.Runnable target, java.lang.String name) { in Thread() method in Thread
[all …]
/libcore/luni/src/test/java/libcore/java/io/
DInterruptedStreamTest.java52 Thread.interrupted(); in setUp()
61 Thread.interrupted(); // clear interrupted bit in tearDown()
121 Thread thread = interruptMeLater(); in testInterruptInputStream()
132 Thread thread = interruptMeLater(); in testInterruptReader()
143 Thread thread = interruptMeLater(); in testInterruptReadableChannel()
154 Thread thread = interruptMeLater(); in testInterruptOutputStream()
167 Thread thread = interruptMeLater(); in testInterruptWriter()
180 Thread thread = interruptMeLater(); in testInterruptWritableChannel()
193 private Thread interruptMeLater() throws Exception { in interruptMeLater()
194 final Thread toInterrupt = Thread.currentThread(); in interruptMeLater()
[all …]
/libcore/ojluni/src/main/java/jdk/internal/misc/
DInnocuousThread.java38 public final class InnocuousThread extends Thread {
56 public static Thread newThread(Runnable target) { in newThread()
64 public static Thread newThread(String name, Runnable target) { in newThread()
66 new PrivilegedAction<Thread>() { in newThread()
68 public Thread run() { in newThread()
81 public static Thread newSystemThread(Runnable target) {
88 public static Thread newSystemThread(String name, Runnable target) {
90 new PrivilegedAction<Thread>() {
92 public Thread run() {
132 if (Thread.currentThread() == this && !hasRun) {
[all …]
/libcore/ojluni/annotations/sdk/nullability/java/lang/
DThread.annotated.java38 public class Thread implements java.lang.Runnable { class
40 public Thread() { throw new RuntimeException("Stub!"); } in Thread() method in Thread
42 public Thread(@libcore.util.Nullable java.lang.Runnable target) { throw new RuntimeException("Stub!… in Thread() method in Thread
44 public Thread(@libcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.Nullable java.lang.… in Thread() method in Thread
46 public Thread(@libcore.util.NonNull java.lang.String name) { throw new RuntimeException("Stub!"); } in Thread() method in Thread
48 public Thread(@libcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.NonNull java.lang.S… in Thread() method in Thread
50 public Thread(@libcore.util.Nullable java.lang.Runnable target, @libcore.util.NonNull java.lang.Str… in Thread() method in Thread
52 public Thread(@libcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.Nullable java.lang.… in Thread() method in Thread
54 public Thread(@libcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.Nullable java.lang.… in Thread() method in Thread
56 public Thread(@libcore.util.Nullable java.lang.ThreadGroup group, @libcore.util.Nullable java.lang.… in Thread() method in Thread
[all …]
/libcore/ojluni/src/main/java/java/lang/
DThread.java144 class Thread implements Runnable { class
316 public static native Thread currentThread(); in currentThread()
423 if (Thread.interrupted()) { in sleep()
508 private Thread(ThreadGroup g, Runnable target, String name, in Thread() method in Thread
517 Thread parent = currentThread(); in Thread()
606 public Thread() { in Thread() method in Thread
622 public Thread(Runnable target) { in Thread() method in Thread
631 Thread(Runnable target, AccessControlContext acc) { in Thread() method in Thread
658 public Thread(ThreadGroup group, Runnable target) { in Thread() method in Thread
670 public Thread(String name) { in Thread() method in Thread
[all …]
/libcore/ojluni/src/test/java/lang/StackWalker/
DDumpStackTest.java85 new CallFrame(Thread.class, "getStackTrace"), in test()
94 new CallFrame(Thread.class, "run"), in test()
97 assertStackTrace(Thread.currentThread().getStackTrace(), callStack); in test()
114 Thread t1 = new Thread() { in testThread()
125 new CallFrame(Thread.class, "getStackTrace"), in testThread()
129 assertStackTrace(Thread.currentThread().getStackTrace(), callStack); in testThread()
149 new CallFrame(Thread.class, "getStackTrace"), in consumeLambda()
160 new CallFrame(Thread.class, "run") in consumeLambda()
162 assertStackTrace(Thread.currentThread().getStackTrace(), callStack); in consumeLambda()
177 new CallFrame(Thread.class, "getStackTrace"), in methodInvoke()
[all …]
/libcore/luni/src/test/java/libcore/java/util/concurrent/
DReentrantReadWriteLockTest.java69 public Collection<Thread> getQueuedReaderThreads() { in getQueuedReaderThreads()
74 public Collection<Thread> getQueuedWriterThreads() { in getQueuedWriterThreads()
79 private void waitForQueuedThread(DefaultReentrantReadWriteLock lock, Thread thread) { in waitForQueuedThread()
101 Thread thread1 = new Thread(new ReadLockRunnable(lock)); in testGetQueuedReaderThreads()
102 Thread thread2 = new Thread(new ReadLockRunnable(lock)); in testGetQueuedReaderThreads()
120 Thread thread1 = new Thread(new WriteLockRunnable(lock)); in testGetQueuedWriterThreads()
121 Thread thread2 = new Thread(new WriteLockRunnable(lock)); in testGetQueuedWriterThreads()

12345678910>>...17