|
@@ -1,13 +1,18 @@
|
|
|
|
|
|
class Main {
|
|
|
+ static Mutex sharedMutex;
|
|
|
+
|
|
|
public static void main(String args[]){
|
|
|
System.out.println("Start thread lab");
|
|
|
|
|
|
- // Create different mutex
|
|
|
- Mutex mutD = new MutexTypeD();
|
|
|
+ sharedMutex = new MutexTypeD();
|
|
|
+
|
|
|
+ runExperiment();
|
|
|
+ }
|
|
|
|
|
|
- Task t0 = new Task("T0", 0, mutD);
|
|
|
- Task t1 = new Task("T1", 1, mutD);
|
|
|
+ private static void runExperiment() {
|
|
|
+ Task t0 = new Task("T0", 0, sharedMutex);
|
|
|
+ Task t1 = new Task("T1", 1, sharedMutex);
|
|
|
|
|
|
t0.describe();
|
|
|
t1.describe();
|