summaryrefslogtreecommitdiff
path: root/Year_3/TSDWL/ex_20131219/MainThread.java
blob: ea6287180de1637110875a96fd5d8163ab52b979 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
public class MainThread {
    public static void main(String[] args) {
        Shared mem = new Shared();
        Thread1 t1 = new Thread1(mem);
        Thread2 t2 = new Thread2(mem);

        t1.start();
        t2.start();

        try {
            t1.join();
            t2.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}