Home
last modified time | relevance | path

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

12345678

/libcore/luni/src/test/java/libcore/java/lang/
DOldThreadTest.java50 st = new Thread(tg, new SimpleThread(1), "SimpleThread3", 1); in test_ConstructorLjava_lang_ThreadGroupLjava_lang_RunnableLjava_lang_StringL$L()
61 new Thread(tg, new SimpleThread(1), "SimpleThread3", in test_ConstructorLjava_lang_ThreadGroupLjava_lang_RunnableLjava_lang_StringL$L()
75 Thread.dumpStack(); in test_dumpStack()
89 boolean b = Thread.holdsLock(this); in enterLocked()
94 boolean b = Thread.holdsLock(this); in enterNonLocked()
103 final Thread parker = new Thread() { in test_joinWithSpuriousInterruption()
112 Thread unparker = new Thread() { in test_joinWithSpuriousInterruption()
117 Thread.sleep(100); in test_joinWithSpuriousInterruption()
136 st = new Thread(); in test_setContextClassLoader()
145 st = new Thread(new SimpleThread(5)); in test_setDaemonZ()
[all …]
DOldThreadGroupTest.java23 public class OldThreadGroupTest extends TestCase implements Thread.UncaughtExceptionHandler {
25 class MyThread extends Thread {
38 Thread.sleep(50); in run()
54 Thread.yield(); in isActivelyRunning()
71 Thread t1 = new Thread(tg, new Runnable() { in test_activeGroupCount()
101 private boolean inListOfThreads(Thread[] threads) { in inListOfThreads()
103 if (Thread.currentThread() == threads[i]) { in inListOfThreads()
113 Thread[] listOfThreads = new Thread[numThreads]; in test_enumerateLThreadArray()
123 Thread[] listOfThreads = new Thread[numThreads]; in test_enumerateLThreadArrayLZtest_enumerateLThreadArrayLZ()
148 Thread.sleep(500); in test_enumerateLThreadArrayLZtest_enumerateLThreadArrayLZ()
[all …]
/libcore/luni/src/main/java/java/lang/
DVMThread.java24 Thread thread;
27 VMThread(Thread t) { in VMThread()
31 native static void create(Thread t, long stacksize); in create()
33 static native Thread currentThread(); in currentThread()
96 static final Thread.State[] STATE_MAP = new Thread.State[] {
97 Thread.State.TERMINATED, // ZOMBIE
98 Thread.State.RUNNABLE, // RUNNING
99 Thread.State.TIMED_WAITING, // TIMED_WAIT
100 Thread.State.BLOCKED, // MONITOR
101 Thread.State.WAITING, // WAIT
[all …]
DThread.java71 public class Thread implements Runnable { class
204 public Thread() { in Thread() method in Thread
220 public Thread(Runnable runnable) { in Thread() method in Thread
238 public Thread(Runnable runnable, String threadName) { in Thread() method in Thread
258 public Thread(String threadName) { in Thread() method in Thread
287 public Thread(ThreadGroup group, Runnable runnable) { in Thread() method in Thread
312 public Thread(ThreadGroup group, Runnable runnable, String threadName) { in Thread() method in Thread
338 public Thread(ThreadGroup group, String threadName) { in Thread() method in Thread
372 public Thread(ThreadGroup group, Runnable runnable, String threadName, long stackSize) { in Thread() method in Thread
386 Thread(ThreadGroup group, String name, int priority, boolean daemon) { in Thread() method in Thread
[all …]
DThreadGroup.java26 public class ThreadGroup implements Thread.UncaughtExceptionHandler {
35 private int maxPriority = Thread.MAX_PRIORITY;
46 private Thread[] childrenThreads = new Thread[5];
95 this(Thread.currentThread().getThreadGroup(), name); in ThreadGroup()
112 if (Thread.currentThread() != null) { in ThreadGroup()
191 final void add(Thread thread) throws IllegalThreadStateException { in add()
195 Thread[] newThreads = new Thread[childrenThreads.length * 2]; in add()
342 public int enumerate(Thread[] threads) { in enumerate()
359 public int enumerate(Thread[] threads, boolean recurse) { in enumerate()
422 if (!enumeratingThreads || ((Thread) immediateCollection[i]).isAlive()) { in enumerateGeneric()
[all …]
/libcore/luni/src/test/java/tests/api/java/util/concurrent/
DAbstractQueuedSynchronizerTest.java125 Thread t1 = new Thread(new InterruptedSyncRunnable(sync)); in testhasQueuedThreads()
126 Thread t2 = new Thread(new InterruptibleSyncRunnable(sync)); in testhasQueuedThreads()
130 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
133 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
136 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
139 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
161 Thread t1 = new Thread(new InterruptedSyncRunnable(sync)); in testIsQueued()
162 Thread t2 = new Thread(new InterruptibleSyncRunnable(sync)); in testIsQueued()
167 Thread.sleep(SHORT_DELAY_MS); in testIsQueued()
170 Thread.sleep(SHORT_DELAY_MS); in testIsQueued()
[all …]
DAbstractQueuedLongSynchronizerTest.java128 Thread t1 = new Thread(new InterruptedSyncRunnable(sync)); in testhasQueuedThreads()
129 Thread t2 = new Thread(new InterruptibleSyncRunnable(sync)); in testhasQueuedThreads()
133 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
136 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
139 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
142 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
164 Thread t1 = new Thread(new InterruptedSyncRunnable(sync)); in testIsQueued()
165 Thread t2 = new Thread(new InterruptibleSyncRunnable(sync)); in testIsQueued()
170 Thread.sleep(SHORT_DELAY_MS); in testIsQueued()
173 Thread.sleep(SHORT_DELAY_MS); in testIsQueued()
[all …]
DExchangerTest.java26 Thread t1 = new Thread(new CheckedRunnable() { in testExchange()
31 Thread t2 = new Thread(new CheckedRunnable() { in testExchange()
48 Thread t1 = new Thread(new CheckedRunnable() { in testTimedExchange()
53 Thread t2 = new Thread(new CheckedRunnable() { in testTimedExchange()
70 Thread t = new Thread(new CheckedInterruptedRunnable() { in testExchange_InterruptedException()
76 Thread.sleep(SHORT_DELAY_MS); in testExchange_InterruptedException()
86 Thread t = new Thread(new CheckedInterruptedRunnable() { in testTimedExchange_InterruptedException()
92 Thread.sleep(SHORT_DELAY_MS); in testTimedExchange_InterruptedException()
102 Thread t = new ThreadShouldThrow(TimeoutException.class) { in testExchange_TimeOutException()
116 Thread t1 = new Thread(new CheckedInterruptedRunnable() { in testReplacementAfterExchange()
[all …]
DLockSupportTest.java25 Thread t = new Thread(new CheckedRunnable() { in testPark()
31 Thread.sleep(SHORT_DELAY_MS); in testPark()
40 Thread t = new Thread(new CheckedRunnable() { in testPark2()
42 Thread.sleep(SHORT_DELAY_MS); in testPark2()
55 Thread t = new Thread(new CheckedRunnable() { in testPark3()
61 Thread.sleep(SHORT_DELAY_MS); in testPark3()
72 Thread t = new Thread(new CheckedRunnable() { in testPark4()
79 Thread.sleep(SHORT_DELAY_MS); in testPark4()
89 Thread t = new Thread(new CheckedRunnable() { in testParkNanos()
103 Thread t = new Thread(new CheckedRunnable() { in testParkUntil()
DReentrantLockTest.java52 public Collection<Thread> getQueuedThreads() { in getQueuedThreads()
55 public Collection<Thread> getWaitingThreads(Condition c) { in getWaitingThreads()
117 Thread t1 = new Thread(new InterruptedLockRunnable(lock)); in testhasQueuedThreads()
118 Thread t2 = new Thread(new InterruptibleLockRunnable(lock)); in testhasQueuedThreads()
122 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
125 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
128 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
131 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
142 Thread t1 = new Thread(new InterruptedLockRunnable(lock)); in testGetQueueLength()
143 Thread t2 = new Thread(new InterruptibleLockRunnable(lock)); in testGetQueueLength()
[all …]
DThreadTest.java18 static class MyHandler implements Thread.UncaughtExceptionHandler {
19 public void uncaughtException(Thread t, Throwable e) { in uncaughtException()
31 Thread current = Thread.currentThread(); in testGetAndSetUncaughtExceptionHandler()
46 assertEquals(null, Thread.getDefaultUncaughtExceptionHandler()); in testGetAndSetDefaultUncaughtExceptionHandler()
50 Thread current = Thread.currentThread(); in testGetAndSetDefaultUncaughtExceptionHandler()
53 Thread.setDefaultUncaughtExceptionHandler(eh); in testGetAndSetDefaultUncaughtExceptionHandler()
54 assertEquals(eh, Thread.getDefaultUncaughtExceptionHandler()); in testGetAndSetDefaultUncaughtExceptionHandler()
55 Thread.setDefaultUncaughtExceptionHandler(null); in testGetAndSetDefaultUncaughtExceptionHandler()
59 assertEquals(null, Thread.getDefaultUncaughtExceptionHandler()); in testGetAndSetDefaultUncaughtExceptionHandler()
DReentrantReadWriteLockTest.java52 public Collection<Thread> getQueuedThreads() { in getQueuedThreads()
55 public Collection<Thread> getWaitingThreads(Condition c) { in getWaitingThreads()
192 Thread t = new Thread(new CheckedInterruptedRunnable() { in testWriteLockInterruptibly_Interrupted()
202 Thread.sleep(SHORT_DELAY_MS); in testWriteLockInterruptibly_Interrupted()
204 Thread.sleep(SHORT_DELAY_MS); in testWriteLockInterruptibly_Interrupted()
215 Thread t = new Thread(new CheckedInterruptedRunnable() { in testWriteTryLock_Interrupted()
221 Thread.sleep(SHORT_DELAY_MS); in testWriteTryLock_Interrupted()
233 Thread t = new Thread(new CheckedInterruptedRunnable() { in testReadLockInterruptibly_Interrupted()
239 Thread.sleep(SHORT_DELAY_MS); in testReadLockInterruptibly_Interrupted()
241 Thread.sleep(SHORT_DELAY_MS); in testReadLockInterruptibly_Interrupted()
[all …]
DSemaphoreTest.java27 public Collection<Thread> getQueuedThreads() { in getQueuedThreads()
162 Thread t = new Thread(new CheckedRunnable() { in testAcquireReleaseInDifferentThreads()
171 Thread.sleep(SHORT_DELAY_MS); in testAcquireReleaseInDifferentThreads()
186 Thread t = new Thread(new CheckedRunnable() { in testUninterruptibleAcquireReleaseInDifferentThreads()
195 Thread.sleep(SHORT_DELAY_MS); in testUninterruptibleAcquireReleaseInDifferentThreads()
211 Thread t = new Thread(new CheckedRunnable() { in testTimedAcquireReleaseInDifferentThreads()
234 Thread t = new Thread(new CheckedInterruptedRunnable() { in testAcquire_InterruptedException()
240 Thread.sleep(SHORT_DELAY_MS); in testAcquire_InterruptedException()
251 Thread t = new Thread(new CheckedInterruptedRunnable() { in testTryAcquire_InterruptedException()
257 Thread.sleep(SHORT_DELAY_MS); in testTryAcquire_InterruptedException()
[all …]
DFutureTaskTest.java147 Thread.sleep(SMALL_DELAY_MS); in testCancelInterrupt()
151 Thread t = new Thread(task); in testCancelInterrupt()
153 Thread.sleep(SHORT_DELAY_MS); in testCancelInterrupt()
168 Thread.sleep(MEDIUM_DELAY_MS); in testCancelNoInterrupt()
172 Thread t = new Thread(task); in testCancelNoInterrupt()
174 Thread.sleep(SHORT_DELAY_MS); in testCancelNoInterrupt()
190 Thread t = new Thread(new CheckedRunnable() { in testGet1()
198 Thread.sleep(SHORT_DELAY_MS); in testGet1()
214 Thread t = new Thread(new CheckedRunnable() { in testTimedGet1()
222 Thread.sleep(SHORT_DELAY_MS); in testTimedGet1()
[all …]
DCyclicBarrierTest.java88 Thread t = new Thread(new CheckedRunnable() { in testTwoParties()
111 Thread t1 = new ThreadShouldThrow(InterruptedException.class) { in testAwait1_Interrupted_BrokenBarrier()
115 Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) { in testAwait1_Interrupted_BrokenBarrier()
122 Thread.sleep(SHORT_DELAY_MS); in testAwait1_Interrupted_BrokenBarrier()
134 Thread t1 = new ThreadShouldThrow(InterruptedException.class) { in testAwait2_Interrupted_BrokenBarrier()
138 Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) { in testAwait2_Interrupted_BrokenBarrier()
145 Thread.sleep(SHORT_DELAY_MS); in testAwait2_Interrupted_BrokenBarrier()
156 Thread t = new ThreadShouldThrow(TimeoutException.class) { in testAwait3_TimeOutException()
171 Thread t1 = new ThreadShouldThrow(TimeoutException.class) { in testAwait4_Timeout_BrokenBarrier()
175 Thread t2 = new ThreadShouldThrow(BrokenBarrierException.class) { in testAwait4_Timeout_BrokenBarrier()
[all …]
DSynchronousQueueTest.java148 Thread t = new Thread(new CheckedInterruptedRunnable() { in testBlockingPut()
155 Thread.sleep(SHORT_DELAY_MS); in testBlockingPut()
165 Thread t = new Thread(new CheckedRunnable() { in testPutWithTake()
179 Thread.sleep(SHORT_DELAY_MS); in testPutWithTake()
181 Thread.sleep(SHORT_DELAY_MS); in testPutWithTake()
191 Thread t = new Thread(new CheckedInterruptedRunnable() { in testTimedOffer()
198 Thread.sleep(SMALL_DELAY_MS); in testTimedOffer()
209 Thread t = new Thread(new CheckedInterruptedRunnable() { in testTakeFromEmpty()
215 Thread.sleep(SHORT_DELAY_MS); in testTakeFromEmpty()
225 Thread t = new Thread(new CheckedInterruptedRunnable() { in testFairBlockingPut()
[all …]
DCountDownLatchTest.java59 Thread t = new Thread(new CheckedRunnable() { in testAwait()
68 Thread.sleep(SHORT_DELAY_MS); in testAwait()
83 Thread t = new Thread(new CheckedRunnable() { in testTimedAwait()
91 Thread.sleep(SHORT_DELAY_MS); in testTimedAwait()
104 Thread t = new Thread(new CheckedInterruptedRunnable() { in testAwait_InterruptedException()
121 Thread t = new Thread(new CheckedInterruptedRunnable() { in testTimedAwait_InterruptedException()
128 Thread.sleep(SHORT_DELAY_MS); in testTimedAwait_InterruptedException()
139 Thread t = new Thread(new CheckedRunnable() { in testAwaitTimeout()
DSystemTest.java32 Thread.sleep(1); in testNanoTime1()
34 Thread.sleep(SHORT_DELAY_MS); in testNanoTime1()
36 Thread.sleep(1); in testNanoTime1()
52 Thread.sleep(1); in testNanoTime2()
54 Thread.sleep(SHORT_DELAY_MS); in testNanoTime2()
56 Thread.sleep(1); in testNanoTime2()
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/
DThreadStateTest.java26 @TestTargetClass(Thread.State.class)
29 Thread.State [] exStates = { Thread.State.NEW, Thread.State.RUNNABLE,
30 Thread.State.BLOCKED, Thread.State.WAITING,
31 Thread.State.TIMED_WAITING, Thread.State.TERMINATED };
44 assertEquals(exStates[i], Thread.State.valueOf(spNames[i])); in test_valueOfLString()
50 Thread.State.valueOf(s); in test_valueOfLString()
66 Thread.State [] thStates = Thread.State.values(); in test_values()
68 for(Thread.State ts:thStates) { in test_values()
74 boolean isContain(Thread.State state) { in isContain()
75 for(Thread.State ts:exStates) { in isContain()
/libcore/luni/src/test/java/tests/api/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(1000, parkerThread)); in test_parkFor_1()
66 Thread parkerThread = new Thread(parker); in test_parkFor_2()
67 Thread waiterThread = in test_parkFor_2()
68 new Thread(new WaitAndUnpark(300, parkerThread)); in test_parkFor_2()
78 Thread parkerThread = new Thread(parker); in test_parkFor_3()
88 Thread parkerThread = new Thread(parker); in test_parkUntil_1()
89 Thread waiterThread = in test_parkUntil_1()
90 new Thread(new WaitAndUnpark(1000, parkerThread)); in test_parkUntil_1()
[all …]
/libcore/luni/src/main/java/java/util/concurrent/locks/
DLockSupport.java101 (java.lang.Thread.class.getDeclaredField("parkBlocker"));
105 private static void setBlocker(Thread t, Object arg) { in setBlocker()
121 public static void unpark(Thread thread) { in unpark()
155 Thread t = Thread.currentThread(); in park()
195 Thread t = Thread.currentThread(); in parkNanos()
236 Thread t = Thread.currentThread(); in parkUntil()
252 public static Object getBlocker(Thread t) { in getBlocker()
DReentrantLock.java105 final Thread current = Thread.currentThread(); in nonfairTryAcquire()
125 if (Thread.currentThread() != getExclusiveOwnerThread()) in tryRelease()
139 return getExclusiveOwnerThread() == Thread.currentThread(); in isHeldExclusively()
148 final Thread getOwner() { in getOwner()
183 setExclusiveOwnerThread(Thread.currentThread()); in lock()
208 final Thread current = Thread.currentThread(); in tryAcquire()
591 protected Thread getOwner() { in getOwner()
621 public final boolean hasQueuedThread(Thread thread) { in hasQueuedThread()
651 protected Collection<Thread> getQueuedThreads() { in getQueuedThreads()
718 protected Collection<Thread> getWaitingThreads(Condition condition) { in getWaitingThreads()
[all …]
DReentrantReadWriteLock.java252 final long tid = Thread.currentThread().getId();
307 private transient Thread firstReader = null;
365 Thread current = Thread.currentThread(); in tryAcquire()
386 Thread current = Thread.currentThread(); in tryReleaseShared()
437 Thread current = Thread.currentThread(); in tryAcquireShared()
468 final int fullTryAcquireShared(Thread current) { in fullTryAcquireShared()
529 Thread current = Thread.currentThread(); in tryWriteLock()
550 Thread current = Thread.currentThread(); in tryReadLock()
581 return getExclusiveOwnerThread() == Thread.currentThread(); in isHeldExclusively()
590 final Thread getOwner() { in getOwner()
[all …]
/libcore/luni/src/main/java/org/apache/xml/utils/
DThreadControllerWrapper.java33 public static Thread runThread(Runnable runnable, int priority) in runThread()
38 public static void waitThread(Thread worker, Runnable task) in waitThread()
66 public Thread run(Runnable task, int priority) in run()
69 Thread t = new Thread(task); in run()
87 public void waitThread(Thread worker, Runnable task) in waitThread()
/libcore/dalvik/src/main/java/dalvik/system/
DSamplingProfiler.java87 private final Map<Thread, Integer> threadIds = new HashMap<Thread, Integer>();
152 public Thread[] threads(); in threads()
162 public static ThreadSet newArrayThreadSet(Thread... threads) { in newArrayThreadSet()
171 private final Thread[] threads;
172 public ArrayThreadSet(Thread... threads) { in ArrayThreadSet()
178 public Thread[] threads() { in threads()
198 private Thread[] threads;
215 threads = new Thread[count*2]; in resize()
219 public Thread[] threads() { in threads()
291 private Thread timerThread;
[all …]

12345678