Home
last modified time | relevance | path

Searched refs:thread (Results 1 – 25 of 54) sorted by relevance

123

/libcore/ojluni/src/main/java/java/io/
DSerialCallbackContext.java46 private Thread thread; field in SerialCallbackContext
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()
75 thread = null; in checkAndSetUsed()
79 thread = null; in setUsed()
/libcore/luni/src/test/java/libcore/java/io/
DInterruptedStreamTest.java121 Thread thread = interruptMeLater(); in testInterruptInputStream() local
127 confirmInterrupted(thread); in testInterruptInputStream()
132 Thread thread = interruptMeLater(); in testInterruptReader() local
138 confirmInterrupted(thread); in testInterruptReader()
143 Thread thread = interruptMeLater(); in testInterruptReadableChannel() local
149 confirmInterrupted(thread); in testInterruptReadableChannel()
154 Thread thread = interruptMeLater(); in testInterruptOutputStream() local
162 confirmInterrupted(thread); in testInterruptOutputStream()
167 Thread thread = interruptMeLater(); in testInterruptWriter() local
175 confirmInterrupted(thread); in testInterruptWriter()
[all …]
/libcore/libart/src/main/java/java/lang/
DDaemons.java98 private Thread thread; field in Daemons.Daemon
117 if (thread != null) { in startInternal()
120 thread = new Thread(ThreadGroup.systemThreadGroup, this, name); in startInternal()
121 thread.setDaemon(true); in startInternal()
122 thread.setSystemDaemon(true); in startInternal()
123 thread.start(); in startInternal()
148 return thread != null; in isRunning()
152 interrupt(thread); in interrupt()
155 public synchronized void interrupt(Thread thread) { in interrupt() argument
156 if (thread == null) { in interrupt()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DLoadLocaleProviderTestHelper.java29 Thread thread = new Thread(this); in LoadLocaleProviderTestHelper() local
30 thread.setContextClassLoader(loader); in LoadLocaleProviderTestHelper()
31 thread.start(); in LoadLocaleProviderTestHelper()
32 thread.join(); in LoadLocaleProviderTestHelper()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DThreadGroupTest.java512 Thread thread = new Thread(testRoot, null, "suicidal thread") { in test_uncaughtException_threadDeath() local
518 thread.start(); in test_uncaughtException_threadDeath()
519 waitForThreadToDieUninterrupted(thread); in test_uncaughtException_threadDeath()
520 testThreadDefaultUncaughtExceptionHandler.assertWasCalled(thread, threadDeath); in test_uncaughtException_threadDeath()
546 Thread thread = new Thread(testRoot, null, "no-op thread"); in test_uncaughtException_naturalDeath() local
547 thread.start(); in test_uncaughtException_naturalDeath()
548 waitForThreadToDieUninterrupted(thread); in test_uncaughtException_naturalDeath()
580 Thread thread = new Thread(testRoot, null, "RuntimeException thread") { in test_uncaughtException_runtimeException() local
586 thread.start(); in test_uncaughtException_runtimeException()
587 waitForThreadToDieUninterrupted(thread); in test_uncaughtException_runtimeException()
[all …]
DProcessManagerTest.java31 Thread thread = null; field in ProcessManagerTest
60 thread = new Thread() { in testSleep()
85 thread.interrupt(); in testSleep()
88 thread.start(); in testSleep()
101 thread.interrupt(); in testSleep()
140 Thread thread = new Thread() { in logErrors() local
155 thread.setDaemon(true); in logErrors()
156 thread.start(); in logErrors()
/libcore/luni/src/test/java/libcore/java/lang/
DOldThreadGroupTest.java129 for(MyThread thread : newThreads) { in test_enumerateLThreadArrayLZtest_enumerateLThreadArrayLZ()
130 thread.start(); in test_enumerateLThreadArrayLZtest_enumerateLThreadArrayLZ()
143 for(MyThread thread : newThreads) { in test_enumerateLThreadArrayLZtest_enumerateLThreadArrayLZ()
144 thread.interrupt(); in test_enumerateLThreadArrayLZtest_enumerateLThreadArrayLZ()
281 Thread thread = launchFiveSecondDummyThread(group); in test_resume() local
297 Thread thread = new Thread(group, "Bar") { in launchFiveSecondDummyThread() local
307 thread.start(); in launchFiveSecondDummyThread()
309 return thread; in launchFiveSecondDummyThread()
337 for (MyThread thread : myThreads) { in tearDown()
338 thread.interrupt(); in tearDown()
[all …]
DOldInheritableThreadLocalTest.java38 Thread thread = new Thread() { in test_Ljava_lang_InheritableThreadLocal() local
43 thread.start(); in test_Ljava_lang_InheritableThreadLocal()
44 thread.join(); in test_Ljava_lang_InheritableThreadLocal()
DOldThreadTest.java158 Thread thread = new Thread() { in launchFiveSecondDummyThread() local
168 thread.start(); in launchFiveSecondDummyThread()
170 return thread; in launchFiveSecondDummyThread()
392 Thread thread = launchFiveSecondDummyThread(); in test_stop() local
401 thread.stop(); in test_stop()
419 Thread thread = new Thread() { in test_stopLjava_lang_Throwable_subtest0() local
429 thread.start(); in test_stopLjava_lang_Throwable_subtest0()
437 thread.stop(new Exception("Oops!")); in test_stopLjava_lang_Throwable_subtest0()
445 Thread thread = launchFiveSecondDummyThread(); in test_suspend() local
454 thread.suspend(); in test_suspend()
DThreadTest.java269 Thread thread = new Thread() { in testThreadDoubleStart() local
280 thread.start(); in testThreadDoubleStart()
282 thread.start(); in testThreadDoubleStart()
290 thread.join(); in testThreadDoubleStart()
300 Thread thread = new Thread(); in testThreadRestart() local
301 thread.start(); in testThreadRestart()
303 thread.join(); in testThreadRestart()
307 thread.start(); in testThreadRestart()
/libcore/luni/src/test/java/libcore/java/util/logging/
DOldLogRecordTest.java53 MockThread thread = new MockThread(); in testGetSetThreadID_DifferentThread() local
54 thread.start(); in testGetSetThreadID_DifferentThread()
56 thread.join(); in testGetSetThreadID_DifferentThread()
70 assertTrue(lr.getThreadID() != thread.lr.getThreadID()); in testGetSetThreadID_DifferentThread()
72 assertTrue(thread.lr.getThreadID() != thread2.lr.getThreadID()); in testGetSetThreadID_DifferentThread()
/libcore/luni/src/test/java/libcore/java/nio/channels/
DOldServerSocketChannelTest.java97 MyThread thread = new MyThread(); in test_accept_Block_NoConnect_interrupt() local
98 thread.start(); in test_accept_Block_NoConnect_interrupt()
101 thread.interrupt(); in test_accept_Block_NoConnect_interrupt()
105 if (thread.errMsg != null) { in test_accept_Block_NoConnect_interrupt()
106 fail(thread.errMsg); in test_accept_Block_NoConnect_interrupt()
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/
DTestThread.java34 Thread thread = null; in launcher() local
38 thread = new Thread(this); in launcher()
39 thread.start(); in launcher()
41 thread.join(); in launcher()
DCipherThread.java75 Thread thread = null; in launcher() local
83 thread = new Thread(this); in launcher()
84 thread.start(); in launcher()
86 thread.join(); in launcher()
/libcore/ojluni/src/main/java/java/util/
DTimer.java108 private final TimerThread thread = new TimerThread(queue); field in Timer
120 thread.newTasksMayBeScheduled = false;
166 thread.setName(name); in Timer()
167 thread.start(); in Timer()
181 thread.setName(name); in Timer()
182 thread.setDaemon(isDaemon); in Timer()
183 thread.start(); in Timer()
403 if (!thread.newTasksMayBeScheduled) in sched()
437 thread.newTasksMayBeScheduled = false; in cancel()
/libcore/ojluni/src/main/java/sun/nio/ch/
DSinkChannelImpl.java50 private volatile long thread = 0; field in SinkChannelImpl
89 long th = thread; in implCloseSelectableChannel()
165 thread = NativeThread.current(); in write()
171 thread = 0; in write()
188 thread = NativeThread.current(); in write()
194 thread = 0; in write()
DSourceChannelImpl.java51 private volatile long thread = 0; field in SourceChannelImpl
90 long th = thread; in implCloseSelectableChannel()
170 thread = NativeThread.current(); in read()
176 thread = 0; in read()
201 thread = NativeThread.current(); in read()
207 thread = 0; in read()
/libcore/ojluni/src/main/java/java/util/concurrent/locks/
DAbstractOwnableSynchronizer.java73 protected final void setExclusiveOwnerThread(Thread thread) { in setExclusiveOwnerThread() argument
74 exclusiveOwnerThread = thread; in setExclusiveOwnerThread()
DAbstractQueuedLongSynchronizer.java195 node.thread = null; in setHead()
228 LockSupport.unpark(s.thread); in unparkSuccessor()
313 node.thread = null; in cancelAcquire()
340 pred.thread != null) { in cancelAcquire()
967 s.prev == head && (st = s.thread) != null) || in fullGetFirstQueuedThread()
969 s.prev == head && (st = s.thread) != null)) in fullGetFirstQueuedThread()
982 Thread t = p.thread; in fullGetFirstQueuedThread()
999 public final boolean isQueued(Thread thread) { in isQueued() argument
1000 if (thread == null) in isQueued()
1003 if (p.thread == thread) in isQueued()
[all …]
DAbstractQueuedSynchronizer.java466 volatile Thread thread; field in AbstractQueuedSynchronizer.Node
661 node.thread = null; in setHead()
694 LockSupport.unpark(s.thread); in unparkSuccessor()
779 node.thread = null; in cancelAcquire()
806 pred.thread != null) { in cancelAcquire()
1441 s.prev == head && (st = s.thread) != null) || in fullGetFirstQueuedThread()
1443 s.prev == head && (st = s.thread) != null)) in fullGetFirstQueuedThread()
1456 Thread t = p.thread; in fullGetFirstQueuedThread()
1473 public final boolean isQueued(Thread thread) { in isQueued() argument
1474 if (thread == null) in isQueued()
[all …]
DLockSupport.java154 public static void unpark(Thread thread) { in unpark() argument
155 if (thread != null) in unpark()
156 U.unpark(thread); in unpark()
/libcore/ojluni/src/main/java/java/util/concurrent/
DFutureTask.java354 volatile Thread thread; field in FutureTask.WaitNode
356 WaitNode() { thread = Thread.currentThread(); } in WaitNode()
368 Thread t = q.thread; in finishCompletion()
370 q.thread = null; in finishCompletion()
411 q.thread = null; in awaitDone()
466 node.thread = null; in removeWaiter()
471 if (q.thread != null) in removeWaiter()
475 if (pred.thread == null) // check for race in removeWaiter()
DPhaser.java975 (t = q.thread) != null) { in releaseWaiters()
976 q.thread = null; in releaseWaiters()
997 if (q == null || ((t = q.thread) != null && q.phase == p)) in abortWait()
1000 q.thread = null; in abortWait()
1070 if (node.thread != null) in internalAwaitAdvance()
1071 node.thread = null; // avoid need for unpark() in internalAwaitAdvance()
1092 volatile Thread thread; // nulled to cancel wait field in Phaser.QNode
1103 thread = Thread.currentThread(); in QNode()
1107 if (thread == null) in isReleasable()
1110 thread = null; in isReleasable()
[all …]
/libcore/ojluni/src/main/native/
DNativeThread.c99 NativeThread_signal(JNIEnv *env, jclass cl, jlong thread) in NativeThread_signal() argument
103 ret = thr_kill((thread_t)thread, INTERRUPT_SIGNAL); in NativeThread_signal()
105 ret = pthread_kill((pthread_t)thread, INTERRUPT_SIGNAL); in NativeThread_signal()
/libcore/jsr166-tests/src/test/java/jsr166/
DJSR166TestCase.java247 Thread thread = new Thread(checkForWedgedTest, "checkForWedgedTest");
248 thread.setDaemon(true);
249 thread.start(); in thread.start()
682 Thread thread = survivors[i]; in checkForkJoinPoolThreadLeaks() local
683 String name = thread.getName(); in checkForkJoinPoolThreadLeaks()
686 thread.join(LONG_DELAY_MS); in checkForkJoinPoolThreadLeaks()
687 if (thread.isAlive()) in checkForkJoinPoolThreadLeaks()
689 thread); in checkForkJoinPoolThreadLeaks()
983 void assertThreadStaysAlive(Thread thread) {
984 assertThreadStaysAlive(thread, timeoutMillis());
[all …]

123