Home
last modified time | relevance | path

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

12345678910>>...12

/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.java19 import java.lang.Thread.UncaughtExceptionHandler;
44 Thread.currentThread().getContextClassLoader()); in testJavaContextClassLoader()
77 Thread.sleep(millis); in testThreadSleep()
86 Thread.currentThread().interrupt(); in testThreadInterrupted()
88 Thread.sleep(0); in testThreadInterrupted()
91 assertFalse(Thread.currentThread().isInterrupted()); in testThreadInterrupted()
98 Thread.sleep(-1); in testThreadSleepIllegalArguments()
104 Thread.sleep(0, -1); in testThreadSleepIllegalArguments()
110 Thread.sleep(0, 1000000); in testThreadSleepIllegalArguments()
127 Thread.sleep(1000); in testThreadWakeup()
[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 …]
/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 …]
DSystemTest.java39 Thread.sleep(1); in testNanoTime1()
41 Thread.sleep(SHORT_DELAY_MS); in testNanoTime1()
43 Thread.sleep(1); in testNanoTime1()
59 Thread.sleep(1); in testNanoTime2()
61 Thread.sleep(SHORT_DELAY_MS); in testNanoTime2()
63 Thread.sleep(1); in testNanoTime2()
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 …]
DLockSupportTest.java118 Thread t = newStartedThread(new CheckedRunnable() { in testParkBeforeUnpark()
153 Thread t = newStartedThread(new CheckedRunnable() { in testParkAfterUnpark()
157 Thread.yield(); in testParkAfterUnpark()
190 Thread t = newStartedThread(new CheckedRunnable() { in testParkBeforeInterrupt()
196 } while (! Thread.currentThread().isInterrupted()); in testParkBeforeInterrupt()
229 Thread t = newStartedThread(new CheckedRunnable() { in testParkAfterInterrupt()
233 Thread.yield(); in testParkAfterInterrupt()
234 assertTrue(Thread.currentThread().isInterrupted()); in testParkAfterInterrupt()
236 assertTrue(Thread.currentThread().isInterrupted()); in testParkAfterInterrupt()
261 Thread t = newStartedThread(new CheckedRunnable() { in testParkTimesOut()
[all …]
DCountDownLatchTest.java68 Thread t = newStartedThread(new CheckedRunnable() { in testAwait()
93 Thread t = newStartedThread(new CheckedRunnable() { in testTimedAwait()
117 Thread t = newStartedThread(new CheckedRunnable() { in testAwait_Interruptible()
119 Thread.currentThread().interrupt(); in testAwait_Interruptible()
124 assertFalse(Thread.interrupted()); in testAwait_Interruptible()
131 assertFalse(Thread.interrupted()); in testAwait_Interruptible()
148 Thread t = newStartedThread(new CheckedRunnable() { in testTimedAwait_Interruptible()
150 Thread.currentThread().interrupt(); in testTimedAwait_Interruptible()
155 assertFalse(Thread.interrupted()); in testTimedAwait_Interruptible()
162 assertFalse(Thread.interrupted()); in testTimedAwait_Interruptible()
[all …]
DExchangerTest.java37 Thread t1 = newStartedThread(new CheckedRunnable() { in testExchange()
42 Thread t2 = newStartedThread(new CheckedRunnable() { in testExchange()
57 Thread t1 = newStartedThread(new CheckedRunnable() { in testTimedExchange()
62 Thread t2 = newStartedThread(new CheckedRunnable() { in testTimedExchange()
78 Thread t = newStartedThread(new CheckedInterruptedRunnable() { in testExchange_InterruptedException()
95 Thread t = newStartedThread(new CheckedInterruptedRunnable() { in testTimedExchange_InterruptedException()
111 Thread t = newStartedThread(new CheckedRunnable() { in testExchange_TimeoutException()
131 Thread t1 = newStartedThread(new CheckedInterruptedRunnable() { in testReplacementAfterExchange()
137 Thread t2 = newStartedThread(new CheckedRunnable() { in testReplacementAfterExchange()
144 Thread t3 = newStartedThread(new CheckedRunnable() { in testReplacementAfterExchange()
/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()
84 Thread parkerThread = new Thread(parker); in test_parkFor_3()
96 Thread parkerThread = new Thread(parker); in test_parkUntil_1()
97 Thread waiterThread = in test_parkUntil_1()
98 new Thread(new WaitAndUnpark(barrier, 1000, parkerThread)); in test_parkUntil_1()
[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/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/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/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 …]
DThreadGroup.java32 public class ThreadGroup implements java.lang.Thread.UncaughtExceptionHandler {
95 public int enumerate(java.lang.Thread[] list) { in enumerate()
99 public int enumerate(java.lang.Thread[] list, boolean recurse) { in enumerate()
103 private int enumerate(java.lang.Thread[] list, int n, boolean recurse) { in enumerate()
163 void add(java.lang.Thread t) { in add()
167 void threadStartFailed(java.lang.Thread t) { in threadStartFailed()
172 void threadTerminated(java.lang.Thread t) { in threadTerminated()
176 private void remove(java.lang.Thread t) { in remove()
188 public void uncaughtException(java.lang.Thread t, java.lang.Throwable e) { in uncaughtException()
241 java.lang.Thread[] threads;
/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/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()
/libcore/ojluni/src/main/java/java/io/
DSerialCallbackContext.java46 private Thread thread;
51 this.thread = Thread.currentThread(); in SerialCallbackContext()
64 if (thread != null && thread != Thread.currentThread()) { in check()
66 "expected thread: " + thread + ", but got: " + Thread.currentThread()); in check()
71 if (thread != Thread.currentThread()) { in checkAndSetUsed()
/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()
486 Thread parent = currentThread(); in init()
574 public Thread() { in Thread() method in Thread
590 public Thread(Runnable target) { in Thread() method in Thread
598 Thread(Runnable target, AccessControlContext acc) { in Thread() method in Thread
625 public Thread(ThreadGroup group, Runnable target) { in Thread() method in Thread
637 public Thread(String name) { in Thread() method in Thread
[all …]

12345678910>>...12