SGCluster.java

class SGCluster$B1C2 {
// STATE SPACE VARIABLES: 

private static int B1_in , B1_out , C2_in , C2_out ;

// LOCAL VARIABLES: 

private static Object clusterCounterLock = new Object();

/**======================================================**
 **
 ** Generated lock and methods for atomic: B1$enter
 **
 **======================================================**/

public static void B1$enter() {

   synchronized (clusterCounterLock) {
      B1_in ++ ; ;

   }
   synchronized (condition$C2$exit) {
      condition$C2$exit.notify(); 
   }


}


/**======================================================**
 **
 ** Generated lock and methods for await: B1$exit
 **
 **======================================================**/

private static Object condition$B1$exit = new Object();

public static void B1$exit(){
   synchronized (condition$B1$exit) {

      while ( !check$B1$exit())
         try {

            condition$B1$exit.wait();
         } catch (InterruptedException e){}

   }

}
private static boolean check$B1$exit() {

   synchronized (clusterCounterLock) {
      if (B1_out + 1 <= C2_in ) {

         B1_out ++ ; ;
         return true;
      } else

         return false;
   }
}
/**======================================================**
 **
 ** Generated lock and methods for atomic: C2$enter
 **
 **======================================================**/

public static void C2$enter() {

   synchronized (clusterCounterLock) {
      C2_in ++ ; ;

   }
   synchronized (condition$B1$exit) {
      condition$B1$exit.notify(); 
   }


}


/**======================================================**
 **
 ** Generated lock and methods for await: C2$exit
 **
 **======================================================**/

private static Object condition$C2$exit = new Object();

public static void C2$exit(){
   synchronized (condition$C2$exit) {

      while ( !check$C2$exit())
         try {

            condition$C2$exit.wait();
         } catch (InterruptedException e){}

   }

}
private static boolean check$C2$exit() {

   synchronized (clusterCounterLock) {
      if (C2_out + 1 <= B1_in ) {

         C2_out ++ ; ;
         return true;
      } else

         return false;
   }
}
}


syntax highlighted by Code2HTML, v. 0.9