diff options
author | Santo Cariotti <santo@dcariotti.me> | 2021-12-01 23:48:05 +0100 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2021-12-01 23:48:05 +0100 |
commit | 4bcd3b16da0eb0f0efe4fb5eb1e8c6bea9e79cf2 (patch) | |
tree | 6807da54f1f8b7a3f6f669e412adb20e9c9e2a58 /Year_3/TSDWL/ex_20131219/MainThread.java | |
parent | 26d58225f0cb3256bf1c715257d2882271f3ecae (diff) |
tsdwl: adds in java
Diffstat (limited to 'Year_3/TSDWL/ex_20131219/MainThread.java')
-rw-r--r-- | Year_3/TSDWL/ex_20131219/MainThread.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Year_3/TSDWL/ex_20131219/MainThread.java b/Year_3/TSDWL/ex_20131219/MainThread.java new file mode 100644 index 0000000..ea62871 --- /dev/null +++ b/Year_3/TSDWL/ex_20131219/MainThread.java @@ -0,0 +1,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(); + } + } +} |