public void decrement(){
  int counterVal=counter.decrementAndGet();
  if (counterVal == 0) {
    if (null != resourceCallback) {
      resourceCallback.onTransitionToIdle();
    }
    becameIdleAt=SystemClock.uptimeMillis();
  }
  if (debugCounting) {
    if (counterVal == 0) {
      Log.i(TAG,"Resource: " + resourceName + " went idle! (Time spent not idle: "+ (becameIdleAt - becameBusyAt)+ ")");
    }
 else {
      Log.i(TAG,"Resource: " + resourceName + " in-use-count decremented to: "+ counterVal);
    }
  }
  if (counterVal < 0) {
    throw new IllegalArgumentException("Counter has been corrupted!");
  }
}

public void decrement ( ) { int counterVal = counter . decrementAndGet ( ) ; if ( counterVal == 0 ) { if ( null != resourceCallback ) { resourceCallback . onTransitionToIdle ( ) ; } becameIdleAt = SystemClock . uptimeMillis ( ) ; } if ( debugCounting ) { if ( counterVal == 0 ) { Log . i ( TAG , "Resource: " + resourceName + " went idle! (Time spent not idle: " + ( becameIdleAt - becameBusyAt ) + ")" ) ; } else { Log . i ( TAG , "Resource: " + resourceName + " in-use-count decremented to: " + counterVal ) ; } } if ( counterVal < 0 ) { throw new IllegalArgumentException ( "Counter has been corrupted!" ) ; } }
decrements the count of in - flight transactions to the resource being monitored . if this operation results in the counter falling below 0 - an exception is raised .
