Home
last modified time | relevance | path

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

12345678910>>...15

/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/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 …]
DCyclicBarrierTest.java65 Thread.yield(); in awaitNumberWaiting()
131 Thread t = newStartedThread(new CheckedRunnable() { in testTwoParties()
153 Thread t1 = new ThreadShouldThrow(InterruptedException.class) { in testAwait1_Interrupted_BrokenBarrier()
158 Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) { in testAwait1_Interrupted_BrokenBarrier()
179 Thread t1 = new ThreadShouldThrow(InterruptedException.class) { in testAwait2_Interrupted_BrokenBarrier()
184 Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) { in testAwait2_Interrupted_BrokenBarrier()
203 Thread t = newStartedThread(new CheckedRunnable() { in testAwait3_TimeoutException()
222 Thread t1 = newStartedThread(new CheckedRunnable() { in testAwait4_Timeout_BrokenBarrier()
229 Thread t2 = newStartedThread(new CheckedRunnable() { in testAwait4_Timeout_BrokenBarrier()
250 Thread t1 = newStartedThread(new CheckedRunnable() { in testAwait5_Timeout_BrokenBarrier()
[all …]
/libcore/ojluni/src/test/java/awt/font/NumericShaper/
DMTTest.java66 Thread th1 = new Thread(new Work(ns1, expected1)); in main()
67 Thread th2 = new Thread(new Work(ns2, expected2)); in main()
68 Thread th3 = new Thread(new Work(ns1, expected1)); in main()
69 Thread th4 = new Thread(new Work(ns2, expected2)); in main()
70 Thread th5 = new Thread(new Work(ns3, expected1)); in main()
71 Thread th6 = new Thread(new Work(ns4, expected2)); in main()
72 Thread th7 = new Thread(new Work(ns3, expected1)); in main()
73 Thread th8 = new Thread(new Work(ns4, expected2)); in main()
88 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 …]
DCyclicBarrierTest.java46 Thread.yield(); in awaitNumberWaiting()
110 Thread t = newStartedThread(new CheckedRunnable() { in testTwoParties()
132 Thread t1 = new ThreadShouldThrow(InterruptedException.class) { in testAwait1_Interrupted_BrokenBarrier()
137 Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) { in testAwait1_Interrupted_BrokenBarrier()
158 Thread t1 = new ThreadShouldThrow(InterruptedException.class) { in testAwait2_Interrupted_BrokenBarrier()
163 Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) { in testAwait2_Interrupted_BrokenBarrier()
182 Thread t = newStartedThread(new CheckedRunnable() { in testAwait3_TimeoutException()
201 Thread t1 = newStartedThread(new CheckedRunnable() { in testAwait4_Timeout_BrokenBarrier()
208 Thread t2 = newStartedThread(new CheckedRunnable() { in testAwait4_Timeout_BrokenBarrier()
229 Thread t1 = newStartedThread(new CheckedRunnable() { in testAwait5_Timeout_BrokenBarrier()
[all …]
/libcore/ojluni/src/main/java/java/util/concurrent/locks/
DLockSupport.java138 private static void setBlocker(Thread t, Object arg) { in setBlocker()
154 public static void unpark(Thread thread) { in unpark()
188 Thread t = Thread.currentThread(); in park()
228 Thread t = Thread.currentThread(); in parkNanos()
269 Thread t = Thread.currentThread(); in parkUntil()
287 public static Object getBlocker(Thread t) { in getBlocker()
396 Thread t = Thread.currentThread(); in nextSecondarySeed()
415 (Thread.class.getDeclaredField("parkBlocker"));
417 (Thread.class.getDeclaredField("threadLocalRandomSecondarySeed"));
DReentrantLock.java133 final Thread current = Thread.currentThread(); in nonfairTryAcquire()
155 if (Thread.currentThread() != getExclusiveOwnerThread()) in tryRelease()
169 return getExclusiveOwnerThread() == Thread.currentThread(); in isHeldExclusively()
178 final Thread getOwner() { in getOwner()
214 setExclusiveOwnerThread(Thread.currentThread()); in lock()
241 final Thread current = Thread.currentThread(); in tryAcquire()
624 protected Thread getOwner() { in getOwner()
653 public final boolean hasQueuedThread(Thread thread) { in hasQueuedThread()
681 protected Collection<Thread> getQueuedThreads() { in getQueuedThreads()
748 protected Collection<Thread> getWaitingThreads(Condition condition) { in getWaitingThreads()
[all …]
DReentrantReadWriteLock.java281 final long tid = getThreadId(Thread.currentThread());
336 private transient Thread firstReader;
394 Thread current = Thread.currentThread(); in tryAcquire()
415 Thread current = Thread.currentThread(); in tryReleaseShared()
466 Thread current = Thread.currentThread(); in tryAcquireShared()
497 final int fullTryAcquireShared(Thread current) { in fullTryAcquireShared()
558 Thread current = Thread.currentThread(); in tryWriteLock()
579 Thread current = Thread.currentThread(); in tryReadLock()
610 return getExclusiveOwnerThread() == Thread.currentThread(); in isHeldExclusively()
619 final Thread getOwner() { in getOwner()
[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/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/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 @libcore.util.NonNull public static native java.lang.Thread currentThread(); in currentThread()
[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()
/libcore/ojluni/src/main/java/java/lang/
DThread.java143 class Thread implements Runnable { class
169 private Thread threadQ;
317 public static native Thread currentThread(); in currentThread()
424 if (Thread.interrupted()) { in sleep()
485 Thread parent = currentThread(); in init()
573 public Thread() { in Thread() method in Thread
589 public Thread(Runnable target) { in Thread() method in Thread
597 Thread(Runnable target, AccessControlContext acc) { in Thread() method in Thread
624 public Thread(ThreadGroup group, Runnable target) { in Thread() method in Thread
636 public Thread(String name) { in Thread() method in Thread
[all …]
/libcore/ojluni/src/main/java/java/nio/channels/spi/
DAbstractInterruptibleChannel.java146 private volatile Thread interrupted;
159 public void interrupt(Thread target) { in begin()
172 Thread me = Thread.currentThread(); in begin()
200 Thread interrupted = this.interrupted; in end()
201 if (interrupted != null && interrupted == Thread.currentThread()) { in end()
213 Thread.currentThread().blockedOn(intr); in blockedOn()

12345678910>>...15