PageRenderTime 25ms CodeModel.GetById 15ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/src/ThreadsSynchronization/SynchronizationTest.java

https://bitbucket.org/Marin_Abaluta/exercitiul_15
Java | 24 lines | 16 code | 8 blank | 0 comment | 0 complexity | b071576cd6f2a8f9baa15e3a98f3919b MD5 | raw file
 1package ThreadsSynchronization;
 2
 3public class SynchronizationTest {
 4
 5    public static void main(String[] args) {
 6
 7        Sender snd = new Sender();
 8        ThreadedSend t1 = new ThreadedSend(snd, "Hi Terry Williams");
 9        ThreadedSend t2 = new ThreadedSend(snd, "We hope you enjoy the stay at our hotel!");
10
11
12        t1.start();
13        t2.start();
14
15        try {
16            t1.join();
17            t2.join();
18        } catch (InterruptedException e) {
19            e.printStackTrace();
20        }
21
22
23    }
24}