private void blockIfNecessaryUntilCleaned() throws SpaceCleanedException, InterruptedException {
  if (_isCleaned) {
    if (Thread.holdsLock(_cleanedLock))     return;
synchronized (_cleanedLock) {
      long CLEAN_TIMEOUT=10 * 1000;
      while (_isCleaned) {
        _cleanedLock.wait(CLEAN_TIMEOUT);
        if (_isCleaned)         throw new SpaceCleanedException(getServiceName(),"Clean operation timed out after " + CLEAN_TIMEOUT + " ms. for space: "+ getServiceName());
      }
    }
  }
}

private void blockIfNecessaryUntilCleaned ( ) throws SpaceCleanedException , InterruptedException { if ( _isCleaned ) { if ( Thread . holdsLock ( _cleanedLock ) ) return ; synchronized ( _cleanedLock ) { long CLEAN_TIMEOUT = 10 * 1000 ; while ( _isCleaned ) { _cleanedLock . wait ( CLEAN_TIMEOUT ) ; if ( _isCleaned ) throw new SpaceCleanedException ( getServiceName ( ) , "Clean operation timed out after " + CLEAN_TIMEOUT + " ms. for space: " + getServiceName ( ) ) ; } } } }
blocks concurrent calls to space while clean is being performed . when clean operation will finish , a notifyall ( ) will be invoked awakening all waiting concurrent operations .
