Home
last modified time | relevance | path

Searched refs:thread (Results 1 – 25 of 63) 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/luni/src/test/java/libcore/java/lang/
DThreadTest.java169 Thread thread = new Thread(); in setPriority_unstarted() local
170 checkSetPriority_inBounds_succeeds(thread); in setPriority_unstarted()
171 checkSetPriority_outOfBounds_fails(thread); in setPriority_unstarted()
177 Thread thread = new Thread("starting thread") { in setPriority_starting() local
181 int priority = thread.getPriority() + 1; in setPriority_starting()
185 thread.setPriority(priority); in setPriority_starting()
186 thread.start(); in setPriority_starting()
187 assertEquals(priority, thread.getPriority()); in setPriority_starting()
189 thread.join(); in setPriority_starting()
220 private static void checkSetPriority_inBounds_succeeds(Thread thread) { in checkSetPriority_inBounds_succeeds() argument
[all …]
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 = launchFiveSecondFakeThread(group); in test_resume() local
297 Thread thread = new Thread(group, "Bar") { in launchFiveSecondFakeThread() local
307 thread.start(); in launchFiveSecondFakeThread()
309 return thread; in launchFiveSecondFakeThread()
337 for (MyThread thread : myThreads) { in tearDown()
338 thread.interrupt(); in tearDown()
[all …]
DThreadGroupTest.java95 Thread thread = createHangThread(threadGroup); in suspend_shouldThrowUnsupportedOperationException() local
96 thread.start(); in suspend_shouldThrowUnsupportedOperationException()
104 thread.join(); in suspend_shouldThrowUnsupportedOperationException()
112 Thread thread = createHangThread(threadGroup); in stop_shouldThrowUnsupportedOperationException() local
113 thread.start(); in stop_shouldThrowUnsupportedOperationException()
121 thread.join(); in stop_shouldThrowUnsupportedOperationException()
DOldThreadTest.java158 Thread thread = new Thread() { in launchFiveSecondFakeThread() local
168 thread.start(); in launchFiveSecondFakeThread()
170 return thread; in launchFiveSecondFakeThread()
392 Thread thread = launchFiveSecondFakeThread(); 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 = launchFiveSecondFakeThread(); in test_suspend() local
454 thread.suspend(); in test_suspend()
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()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/lang/
DObjectTest.java148 TestThread thread = new TestThread("TestThread " + i); in test_notify() local
149 threads.add(thread); in test_notify()
150 thread.start(); in test_notify()
293 TestThread thread = new TestThread(); in test_wait() local
295 thread.status = 0; in test_wait()
297 thread.start(); in test_wait()
301 assertEquals("Thread woke too early. (status=" + thread.status + ")", in test_wait()
302 0, thread.status); in test_wait()
306 assertEquals("Thread did not get notified. (status=" + thread.status + ")", in test_wait()
307 1, thread.status); in test_wait()
[all …]
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/libart/src/main/java/java/lang/
DDaemons.java100 private Thread thread; field in Daemons.Daemon
119 if (thread != null) { in startInternal()
122 thread = new Thread(ThreadGroup.systemThreadGroup, this, name); in startInternal()
123 thread.setDaemon(true); in startInternal()
124 thread.setSystemDaemon(true); in startInternal()
125 thread.start(); in startInternal()
150 return thread != null; in isRunning()
154 interrupt(thread); in interrupt()
157 public synchronized void interrupt(Thread thread) { in interrupt() argument
158 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/luni/src/test/java/libcore/java/util/concurrent/
DTestUtils.java28 public static void joinThreadOrFail(long timeoutMillis, Thread thread) { in joinThreadOrFail() argument
30 thread.join(timeoutMillis); in joinThreadOrFail()
34 if (thread.getState() != Thread.State.TERMINATED) { in joinThreadOrFail()
35 thread.interrupt(); in joinThreadOrFail()
/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/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/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()
/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/
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/java/java/util/concurrent/locks/
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 …]
DAbstractOwnableSynchronizer.java73 protected final void setExclusiveOwnerThread(Thread thread) { in setExclusiveOwnerThread() argument
74 exclusiveOwnerThread = thread; in setExclusiveOwnerThread()
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 …]
/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()

123