public void guard(final Guard r) throws InterruptedException {
  incThread();
  try {
    r.run();
  }
 catch (  InterruptedException e) {
    throw e;
  }
catch (  Exception e) {
    throw new RuntimeException(e);
  }
 finally {
    decThread();
  }
}

public void guard ( final Guard r ) throws InterruptedException { incThread ( ) ; try { r . run ( ) ; } catch ( InterruptedException e ) { throw e ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } finally { decThread ( ) ; } }
execute a critical region which needs to be interrupted if some condition is violated .
