SGCluster.java

class SGCluster$B4C5 {
// STATE SPACE VARIABLES: 

private static int C5_in , B4_out ;
// LOCAL VARIABLES: 

private static Object clusterCounterLock = new Object();

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

public static void B4$enter() {

   synchronized (clusterCounterLock) {
      B4_in ++ ; ;

   }

}


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

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

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

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

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

   }

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

   synchronized (clusterCounterLock) {
      if (B4_out + 1 <= C5_in ) {

         B4_out ++ ; ;
         return true;
      } else

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

public static void C5$enter() {

   synchronized (clusterCounterLock) {
      C5_in ++ ; ;

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


}

/**======================================================**
 **
 ** Generated lock and methods for atomic: C5$exit
 **
 **======================================================**/

public static void C5$exit() {

   synchronized (clusterCounterLock) {
      C5_out ++ ; ;

   }

}

}


syntax highlighted by Code2HTML, v. 0.9