Procházet zdrojové kódy

Group state change in critical section

This way, the message of going out is not thrown in a critical
section of another thread.
DricomDragon před 5 roky
rodič
revize
613a201611
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1 1
      ta1/Task.java

+ 1 - 1
ta1/Task.java

@@ -21,10 +21,10 @@ class Task extends Thread {
 
 			System.out.println( name + " is CRITICAL!");
 			Mutex.criticalSection(((Integer)id).toString());
+			System.out.println( name + " isn't critical anymore.");
 
 			critical.v(id);
 
-			System.out.println( name + " isn't critical anymore.");
 			Mutex.nonCriticalSection();
 		}
 	}