// Decompiled by DJ v3.11.11.95 Copyright 2009 Atanas Neshkov Date: 26/10/2010 13:58:39
// Home Page: http://members.fortunecity.com/neshkov/dj.html http://www.neshkov.com/dj.html - Check often for new version!
// Decompiler options: packimports(3)
package jcircus.classesdescompiladas;
// Referenced classes of package org.jcsp.lang:
// ProcessInterruptedException, JCSP_InternalError
class AltingBarrierCoordinate
{
AltingBarrierCoordinate()
{
}
static void startEnable()
{
synchronized(activeLock)
{
if(active > 0)
try
{
activeLock.wait();
while(active > 0)
activeLock.wait();
}
catch(InterruptedException interruptedexception)
{
throw new ProcessInterruptedException(interruptedexception.toString());
}
if(active != 0)
throw new JCSP_InternalError("\n*** AltingBarrier enable sequence starting with 'active' count not equal to zero: " + active);
active = 1;
}
}
static void finishEnable()
{
synchronized(activeLock)
{
if(active != 1)
throw new JCSP_InternalError("\n*** AltingBarrier enable sequence finished with 'active' count not equal to one: " + active);
active = 0;
activeLock.notify();
}
}
static void startDisable(int i)
{
if(i <= 0)
throw new JCSP_InternalError("\n*** attempt to start " + i + " disable sequences!");
synchronized(activeLock)
{
if(active != 1)
throw new JCSP_InternalError("\n*** completed AltingBarrier found in ALT sequence with 'active' count not equal to one: " + active);
active = i;
}
}
static void finishDisable()
{
synchronized(activeLock)
{
if(active < 1)
throw new JCSP_InternalError("\n*** AltingBarrier disable sequence finished with 'active' count less than one: " + active);
active--;
if(active == 0)
activeLock.notify();
}
}
private static int active = 0;
private static Object activeLock = new Object();
}