MCPcopy Create free account
hub / github.com/ReadyTalk/avian / main

Method main

test/Threads.java:8–57  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

6 }
7
8 public static void main(String[] args) throws Exception {
9 ((Thread.UncaughtExceptionHandler) Thread.currentThread().getThreadGroup())
10 .uncaughtException(Thread.currentThread(), new Exception());
11
12 { Threads test = new Threads();
13 Thread thread = new Thread(test);
14
15 synchronized (test) {
16 thread.start();
17 test.wait();
18 }
19 }
20
21 { Thread thread = new Thread() {
22 public void run() {
23 while (true) {
24 System.out.print(".");
25 try {
26 sleep(1000);
27 } catch (Exception e) {
28 System.out.println("thread interrupted? " + interrupted());
29 break;
30 }
31 }
32 }
33 };
34 thread.start();
35
36 System.out.println("\nAbout to interrupt...");
37 thread.interrupt();
38 System.out.println("\nInterrupted!");
39 }
40
41 { Thread thread = new Thread() {
42 @Override
43 public void run() {
44 // do nothing
45 }
46 };
47
48 thread.start();
49 thread.join();
50 }
51
52 System.out.println("finished; success? " + success);
53
54 if (! success) {
55 System.exit(-1);
56 }
57 }
58
59 public void run() {
60 int i = 0;

Callers

nothing calls this directly

Calls 9

currentThreadMethod · 0.95
startMethod · 0.95
interruptMethod · 0.95
joinMethod · 0.95
exitMethod · 0.95
getThreadGroupMethod · 0.80
uncaughtExceptionMethod · 0.65
waitMethod · 0.45
printlnMethod · 0.45

Tested by

no test coverage detected