Home
last modified time | relevance | path

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

12345678910

/dalvik/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 …]
/dalvik/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/lang/
DThreadTest.java22 import java.lang.Thread.UncaughtExceptionHandler;
34 @TestTargetClass(Thread.class)
77 Thread parent;
89 Thread.sleep(100); in run()
96 Thread.sleep(500); in run()
100 while (!Thread.currentThread().isInterrupted()) { in run()
103 Thread.sleep(50); in run()
116 public ResSupThread(Thread t) { in ResSupThread()
137 boolean b = Thread.holdsLock(this); in enterLocked()
142 boolean b = Thread.holdsLock(this); in enterNonLocked()
[all …]
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()
/dalvik/libcore/concurrent/src/test/java/tests/api/java/util/concurrent/
DAbstractQueuedSynchronizerTest.java131 Thread t1 = new Thread(new InterruptedSyncRunnable(sync)); in testhasQueuedThreads()
132 Thread t2 = new Thread(new InterruptibleSyncRunnable(sync)); in testhasQueuedThreads()
137 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
140 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
143 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
146 Thread.sleep(SHORT_DELAY_MS); in testhasQueuedThreads()
172 Thread t1 = new Thread(new InterruptedSyncRunnable(sync)); in testIsQueued()
173 Thread t2 = new Thread(new InterruptibleSyncRunnable(sync)); in testIsQueued()
179 Thread.sleep(SHORT_DELAY_MS); in testIsQueued()
182 Thread.sleep(SHORT_DELAY_MS); in testIsQueued()
[all …]
DLockSupportTest.java28 Thread t = new Thread(new Runnable() { in testPark()
39 Thread.sleep(SHORT_DELAY_MS); in testPark()
52 Thread t = new Thread(new Runnable() { in testPark2()
55 Thread.sleep(SHORT_DELAY_MS); in testPark2()
76 Thread t = new Thread(new Runnable() { in testPark3()
80 threadAssertTrue(Thread.interrupted()); in testPark3()
88 Thread.sleep(SHORT_DELAY_MS); in testPark3()
103 Thread t = new Thread(new Runnable() { in testPark4()
128 Thread t = new Thread(new Runnable() { in testParkNanos()
151 Thread t = new Thread(new Runnable() { in testParkUntil()
DCyclicBarrierTest.java98 Thread t = new Thread(new Runnable() { in testTwoParties()
128 Thread t1 = new Thread(new Runnable() { in testAwait1_Interrupted_BrokenBarrier()
139 Thread t2 = new Thread(new Runnable() { in testAwait1_Interrupted_BrokenBarrier()
153 Thread.sleep(SHORT_DELAY_MS); in testAwait1_Interrupted_BrokenBarrier()
168 Thread t1 = new Thread(new Runnable() { in testAwait2_Interrupted_BrokenBarrier()
179 Thread t2 = new Thread(new Runnable() { in testAwait2_Interrupted_BrokenBarrier()
193 Thread.sleep(SHORT_DELAY_MS); in testAwait2_Interrupted_BrokenBarrier()
207 Thread t = new Thread(new Runnable() { in testAwait3_TimeOutException()
233 Thread t1 = new Thread(new Runnable() { in testAwait4_Timeout_BrokenBarrier()
244 Thread t2 = new Thread(new Runnable() { in testAwait4_Timeout_BrokenBarrier()
[all …]
DThreadTest.java26 static class MyHandler implements Thread.UncaughtExceptionHandler {
27 public void uncaughtException(Thread t, Throwable e) { in uncaughtException()
39 Thread current = Thread.currentThread(); in testGetAndSetUncaughtExceptionHandler()
57 assertEquals(null, Thread.getDefaultUncaughtExceptionHandler()); in testGetAndSetDefaultUncaughtExceptionHandler()
61 Thread current = Thread.currentThread(); in testGetAndSetDefaultUncaughtExceptionHandler()
64 Thread.setDefaultUncaughtExceptionHandler(eh); in testGetAndSetDefaultUncaughtExceptionHandler()
65 assertEquals(eh, Thread.getDefaultUncaughtExceptionHandler()); in testGetAndSetDefaultUncaughtExceptionHandler()
66 Thread.setDefaultUncaughtExceptionHandler(null); in testGetAndSetDefaultUncaughtExceptionHandler()
70 assertEquals(null, Thread.getDefaultUncaughtExceptionHandler()); in testGetAndSetDefaultUncaughtExceptionHandler()
DReentrantLockTest.java59 public Collection<Thread> getQueuedThreads() { in getQueuedThreads()
62 public Collection<Thread> getWaitingThreads(Condition c) { in getWaitingThreads()
127 Thread t1 = new Thread(new InterruptedLockRunnable(lock)); in testhasQueuedThreads()
128 Thread t2 = new Thread(new InterruptibleLockRunnable(lock)); 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()
156 Thread t1 = new Thread(new InterruptedLockRunnable(lock)); in testGetQueueLength()
157 Thread t2 = new Thread(new InterruptibleLockRunnable(lock)); in testGetQueueLength()
[all …]
DExchangerTest.java29 Thread t1 = new Thread(new Runnable(){ in testExchange()
41 Thread t2 = new Thread(new Runnable(){ in testExchange()
68 Thread t1 = new Thread(new Runnable(){ in testTimedExchange()
82 Thread t2 = new Thread(new Runnable(){ in testTimedExchange()
111 Thread t = new Thread(new Runnable() { in testExchange_InterruptedException()
122 Thread.sleep(SHORT_DELAY_MS); in testExchange_InterruptedException()
135 Thread t = new Thread(new Runnable() { in testTimedExchange_InterruptedException()
160 Thread t = new Thread(new Runnable() { in testExchange_TimeOutException()
184 Thread t1 = new Thread(new Runnable(){ in testReplacementAfterExchange()
195 Thread t2 = new Thread(new Runnable(){ in testReplacementAfterExchange()
[all …]
DFutureTaskTest.java164 Thread.sleep(MEDIUM_DELAY_MS); in testCancelInterrupt()
170 Thread t = new Thread(task); in testCancelInterrupt()
174 Thread.sleep(SHORT_DELAY_MS); in testCancelInterrupt()
192 Thread.sleep(MEDIUM_DELAY_MS); in testCancelNoInterrupt()
199 Thread t = new Thread(task); in testCancelNoInterrupt()
203 Thread.sleep(SHORT_DELAY_MS); in testCancelNoInterrupt()
220 Thread.sleep(MEDIUM_DELAY_MS); in testGet1()
227 Thread t = new Thread(new Runnable() { in testGet1()
240 Thread.sleep(SHORT_DELAY_MS); in testGet1()
258 Thread.sleep(MEDIUM_DELAY_MS); in testTimedGet1()
[all …]
DReentrantReadWriteLockTest.java59 public Collection<Thread> getQueuedThreads() { in getQueuedThreads()
62 public Collection<Thread> getWaitingThreads(Condition c) { in getWaitingThreads()
161 Thread t = new Thread(new Runnable() { in testWriteLockInterruptibly_Interrupted()
188 Thread t = new Thread(new Runnable() { in testWriteTryLock_Interrupted()
211 Thread t = new Thread(new Runnable() { in testReadLockInterruptibly_Interrupted()
234 Thread t = new Thread(new Runnable() { in testReadTryLock_Interrupted()
258 Thread t = new Thread(new Runnable() { in testWriteTryLockWhenLocked()
278 Thread t = new Thread(new Runnable() { in testReadTryLockWhenLocked()
298 Thread t = new Thread(new Runnable() { in testMultipleReadLocks()
319 Thread t1 = new Thread(new Runnable() { in testWriteAfterMultipleReadLocks()
[all …]
DSemaphoreTest.java29 public Collection<Thread> getQueuedThreads() { in getQueuedThreads()
180 Thread t = new Thread(new Runnable() { in testAcquireReleaseInDifferentThreads()
194 Thread.sleep(SHORT_DELAY_MS); in testAcquireReleaseInDifferentThreads()
211 Thread t = new Thread(new Runnable() { in testUninterruptibleAcquireReleaseInDifferentThreads()
221 Thread.sleep(SHORT_DELAY_MS); in testUninterruptibleAcquireReleaseInDifferentThreads()
239 Thread t = new Thread(new Runnable() { in testTimedAcquireReleaseInDifferentThreads()
270 Thread t = new Thread(new Runnable() { in testAcquire_InterruptedException()
280 Thread.sleep(SHORT_DELAY_MS); in testAcquire_InterruptedException()
293 Thread t = new Thread(new Runnable() { in testTryAcquire_InterruptedException()
304 Thread.sleep(SHORT_DELAY_MS); in testTryAcquire_InterruptedException()
[all …]
DSynchronousQueueTest.java162 Thread t = new Thread(new Runnable() { in testBlockingPut()
173 Thread.sleep(SHORT_DELAY_MS); in testBlockingPut()
187 Thread t = new Thread(new Runnable() { in testPutWithTake()
207 Thread.sleep(SHORT_DELAY_MS); in testPutWithTake()
209 Thread.sleep(SHORT_DELAY_MS); in testPutWithTake()
222 Thread t = new Thread(new Runnable() { in testTimedOffer()
235 Thread.sleep(SMALL_DELAY_MS); in testTimedOffer()
249 Thread t = new Thread(new Runnable() { in testTakeFromEmpty()
259 Thread.sleep(SHORT_DELAY_MS); in testTakeFromEmpty()
272 Thread t = new Thread(new Runnable() { in testFairBlockingPut()
[all …]
/dalvik/vm/
DThread.h83 typedef struct Thread { struct
178 struct Thread* prev; argument
179 struct Thread* next; argument
206 } Thread; argument
220 volatile Thread** pThread;
236 Thread* dvmThreadSelf(void);
239 void dvmLockThreadList(Thread* self);
254 void dvmSuspendThread(Thread* thread);
256 void dvmResumeThread(Thread* thread);
264 bool dvmIsSuspended(Thread* thread);
[all …]
DSync.h24 struct Thread;
62 void dvmLockObject(struct Thread* self, struct Object* obj);
67 bool dvmUnlockObject(struct Thread* self, struct Object* obj);
72 void dvmObjectWait(struct Thread* self, struct Object* obj,
74 void dvmObjectNotify(struct Thread* self, struct Object* obj);
75 void dvmObjectNotifyAll(struct Thread* self, struct Object* obj);
87 void dvmThreadInterrupt(volatile struct Thread* thread);
116 bool dvmHoldsLock(struct Thread* thread, struct Object* obj);
DException.h72 INLINE Object* dvmGetException(Thread* self) { in dvmGetException()
79 INLINE void dvmSetException(Thread* self, Object* exception) in dvmSetException()
92 INLINE void dvmClearException(Thread* self) { in dvmClearException()
101 void dvmClearOptException(Thread* self);
107 INLINE bool dvmCheckException(Thread* self) { in dvmCheckException()
148 int dvmFindCatchBlock(Thread* self, int relPc, Object* exception,
159 void* dvmFillInStackTraceInternal(Thread* thread, bool wantObject, int* pCount);
161 INLINE Object* dvmFillInStackTrace(Thread* thread) { in dvmFillInStackTrace()
166 INLINE int* dvmFillInStackTraceRaw(Thread* thread, int* pCount) { in dvmFillInStackTraceRaw()
/dalvik/libcore/luni-kernel/src/test/java/tests/api/org/apache/harmony/kernel/dalvik/
DThreadsTest.java66 Thread parkerThread = new Thread(parker); in test_parkFor_1()
67 Thread waiterThread = in test_parkFor_1()
68 new Thread(new WaitAndUnpark(1000, parkerThread)); in test_parkFor_1()
85 Thread parkerThread = new Thread(parker); in test_parkFor_2()
86 Thread waiterThread = in test_parkFor_2()
87 new Thread(new WaitAndUnpark(300, parkerThread)); in test_parkFor_2()
104 Thread parkerThread = new Thread(parker); in test_parkFor_3()
121 Thread parkerThread = new Thread(parker); in test_parkUntil_1()
122 Thread waiterThread = in test_parkUntil_1()
123 new Thread(new WaitAndUnpark(1000, parkerThread)); in test_parkUntil_1()
[all …]
/dalvik/libcore/security/src/test/java/tests/security/permissions/
DJavaLangThreadTest.java36 @TestTargetClass(java.lang.Thread.class)
75 Thread t = Thread.currentThread(); in test_setContextClassLoader()
96 args = {java.lang.Thread[].class}
102 Thread t; in test_enumerate()
110 public void checkAccess(Thread t) { in test_enumerate()
121 Thread t = Thread.currentThread(); in test_enumerate()
127 Thread.enumerate(new Thread[]{}); in test_enumerate()
164 Thread t1 = new Thread(); in test_getContextClassLoader()
165 Thread t2 = new Thread(); in test_getContextClassLoader()
166 Thread t3 = new Thread(); in test_getContextClassLoader()
[all …]
/dalvik/libcore/concurrent/src/main/java/java/util/concurrent/locks/
DReentrantLock.java89 transient Thread owner;
103 final Thread current = Thread.currentThread(); in nonfairTryAcquire()
120 if (Thread.currentThread() != owner) in tryRelease()
132 return getState() != 0 && owner == Thread.currentThread(); in isHeldExclusively()
141 final Thread getOwner() { in getOwner()
143 Thread o = owner; in getOwner()
149 Thread o = owner; in getHoldCount()
150 return (o == Thread.currentThread())? c : 0; in getHoldCount()
178 owner = Thread.currentThread(); in lock()
201 final Thread current = Thread.currentThread(); in tryAcquire()
[all …]
DReentrantReadWriteLock.java208 transient Thread owner;
223 Thread current = Thread.currentThread(); in nonfairTryAcquire()
246 owner != Thread.currentThread()) in nonfairTryAcquireShared()
255 Thread current = Thread.currentThread(); in tryRelease()
282 owner == Thread.currentThread(); in isHeldExclusively()
291 final Thread getOwner() { in getOwner()
293 Thread o = owner; in getOwner()
307 Thread o = owner; in getWriteHoldCount()
308 return (o == Thread.currentThread())? c : 0; in getWriteHoldCount()
339 owner = Thread.currentThread(); in wlock()
[all …]
/dalvik/vm/interp/
DStack.h177 bool dvmInitInterpStack(Thread* thread, int stackSize);
183 bool dvmPushJNIFrame(Thread* thread, const Method* method);
188 bool dvmPushLocalFrame(Thread* thread, const Method* method);
189 bool dvmPopLocalFrame(Thread* thread);
196 void dvmCallMethodV(Thread* self, const Method* method, Object* obj,
198 void dvmCallMethodA(Thread* self, const Method* method, Object* obj,
200 void dvmCallMethod(Thread* self, const Method* method, Object* obj,
232 int dvmComputeVagueFrameDepth(Thread* thread, const void* fp);
270 void dvmHandleStackOverflow(Thread* self);
271 void dvmCleanupStackOverflow(Thread* self);
[all …]
/dalvik/libcore/luni-kernel/src/main/java/java/lang/
DThread.java74 public class Thread implements Runnable { class
212 public Thread() { in Thread() method in Thread
230 public Thread(Runnable runnable) { in Thread() method in Thread
250 public Thread(Runnable runnable, String threadName) { in Thread() method in Thread
271 public Thread(String threadName) { in Thread() method in Thread
302 public Thread(ThreadGroup group, Runnable runnable) { in Thread() method in Thread
329 public Thread(ThreadGroup group, Runnable runnable, String threadName) { in Thread() method in Thread
357 public Thread(ThreadGroup group, String threadName) { in Thread() method in Thread
393 public Thread(ThreadGroup group, Runnable runnable, String threadName, long stackSize) { in Thread() method in Thread
407 Thread(ThreadGroup group, String name, int priority, boolean daemon) { in Thread() method in Thread
[all …]
/dalvik/tests/039-join-main/src/
DMain.java8 Thread t; in main()
10 t = new Thread(new JoinMainSub(Thread.currentThread()), "Joiner"); in main()
14 try { Thread.sleep(1000); } in main()
22 private Thread mJoinMe;
24 public JoinMainSub(Thread joinMe) { in JoinMainSub()
/dalvik/tests/054-uncaught/src/
DMain.java16 Thread t = new Helper(which); in testThread()
33 Thread.setDefaultUncaughtExceptionHandler(defHandler); in catchTheUncaught()
37 Thread.currentThread().setUncaughtExceptionHandler( in catchTheUncaught()
42 Thread.setDefaultUncaughtExceptionHandler(defHandler); in catchTheUncaught()
43 Thread.currentThread().setUncaughtExceptionHandler( in catchTheUncaught()
52 private static class Helper extends Thread {
/dalvik/tests/033-class-init-deadlock/src/
DMain.java13 Thread thread1, thread2; in main()
16 thread1 = new Thread() { public void run() { new A(); } }; in main()
17 thread2 = new Thread() { public void run() { new B(); } }; in main()
21 try { Thread.sleep(6000); } catch (InterruptedException ie) { } in main()
36 try { Thread.sleep(3000); } catch (InterruptedException ie) { }
46 try { Thread.sleep(3000); } catch (InterruptedException ie) { }

12345678910