-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.java
More file actions
29 lines (25 loc) · 762 Bytes
/
App.java
File metadata and controls
29 lines (25 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package com.jspiders.multithreading.thread;
public class App {
public static void main(String[] args) throws Exception {
final Running runner = new Running();
Thread t1 = new Thread(new Runnable() {
public void run() {
try {
runner.firstThread();
} catch (InterruptedException e) {}
}
});
Thread t2 = new Thread(new Runnable() {
public void run() {
try {
runner.secondThread();
} catch (InterruptedException e) {}
}
});
t1.start();
t2.start();
t1.join();
t2.join();
runner.finished();
}
}