SGCluster.java
class SGCluster$C1C3 {
// STATE SPACE VARIABLES:
private static int C1_in , C1_out , C3_in , C3_out ;
// LOCAL VARIABLES:
private static Object clusterCounterLock = new Object();
/**======================================================**
**
** Generated lock and methods for await: C1$enter
**
**======================================================**/
private static Object condition$C1$enter = new Object();
public static void C1$enter(){
synchronized (condition$C1$enter) {
while ( !check$C1$enter())
try {
condition$C1$enter.wait();
} catch (InterruptedException e){}
}
}
private static boolean check$C1$enter() {
synchronized (clusterCounterLock) {
if (C1_in == C1_out && C3_in == C3_out ) {
C1_in ++ ; ;
return true;
} else
return false;
}
}
/**======================================================**
**
** Generated lock and methods for atomic: C1$exit
**
**======================================================**/
public static void C1$exit() {
synchronized (clusterCounterLock) {
C1_out ++ ; ;
}
synchronized (condition$C1$enter) {
condition$C1$enter.notify();
}
synchronized (condition$C3$enter) {
condition$C3$enter.notifyAll();
}
}
/**======================================================**
**
** Generated lock and methods for await: C3$enter
**
**======================================================**/
private static Object condition$C3$enter = new Object();
public static void C3$enter(){
synchronized (condition$C3$enter) {
while ( !check$C3$enter())
try {
condition$C3$enter.wait();
} catch (InterruptedException e){}
}
}
private static boolean check$C3$enter() {
synchronized (clusterCounterLock) {
if (C3_in == C3_out && C1_in == C1_out ) {
C3_in ++ ; ;
return true;
} else
return false;
}
}
/**======================================================**
**
** Generated lock and methods for atomic: C3$exit
**
**======================================================**/
public static void C3$exit() {
synchronized (clusterCounterLock) {
C3_out ++ ; ;
}
synchronized (condition$C3$enter) {
condition$C3$enter.notify();
}
synchronized (condition$C1$enter) {
condition$C1$enter.notifyAll();
}
}
}
syntax highlighted by Code2HTML, v. 0.9

