Home | History | Annotate | Download | only in src

Lines Matching defs:thread

23  * Test some basic thread stuff.
28 System.out.println("thread test starting");
36 System.out.println("thread test done");
40 * Simple thread capacity test.
48 for (TestCapacityThread thread : threads) {
49 thread.start();
51 for (TestCapacityThread thread : threads) {
52 thread.join();
55 System.out.println("testThreadCapacity thread count: " + TestCapacityThread.mCount);
58 private static class TestCapacityThread extends Thread {
72 Thread t = new Thread(null, new TestDaemonThread(), "TestDaemonThread", 7168);
76 System.out.print("testThreadDaemons starting thread '" + t.getName() + "'\n");
90 System.out.print("testThreadDaemons @ Thread running\n");
93 Thread.currentThread().setDaemon(true);
100 Thread.sleep(2000);
106 System.out.print("testThreadDaemons @ Thread bailing\n");
112 Thread.currentThread().interrupt();
114 Thread.sleep(0);
117 if (Thread.currentThread().isInterrupted()) {
118 throw new AssertionError("thread is interrupted");
126 Thread thread = new Thread() {
132 thread.start();
133 thread.setName("HelloWorld"); // b/17302037 hang if setName called after start
134 if (!thread.getName().equals("HelloWorld")) {
135 throw new AssertionError("Unexpected thread name: " + thread.getName());
137 thread.join();
138 if (!thread.getName().equals("HelloWorld")) {
139 throw new AssertionError("Unexpected thread name after join: " + thread.getName());
148 t1.setPriority(Thread.MAX_PRIORITY);
151 if (supportsThreadPriorities() && (t1.getNativePriority() != Thread.MAX_PRIORITY)) {
152 System.out.print("thread priority for t1 was " + t1.getNativePriority() +
153 " [expected Thread.MAX_PRIORITY]\n");
159 if (supportsThreadPriorities() && (t2.getNativePriority() != Thread.MAX_PRIORITY)) {
160 System.out.print("thread priority for t2 was " + t2.getNativePriority() +
161 " [expected Thread.MAX_PRIORITY]\n");
168 Thread threads[] = new Thread[10];
169 Thread current = Thread.currentThread();
172 for (Thread t : threads) {
174 System.out.println("Found current Thread in ThreadGroup");
178 throw new RuntimeException("Did not find main thread: " + Arrays.toString(threads));
182 StackTraceElement[] trace = Thread.getAllStackTraces().get(Thread.currentThread());
184 throw new RuntimeException("Did not find main thread: " + Thread.getAllStackTraces());
213 static class PriorityStoringThread extends Thread {
225 setPriority(Thread.MAX_PRIORITY);