Code example for AtomicLong

Methods: get, set

0
  private final void updateFields( long currentRecordCount, long timeStamp )
  { 
    // update available sample count 
    long cnt =
        Math.max( 0L, Math.min( maxSampleCount.get(), currentRecordCount ) );
    availableSampleCount.set( cnt );
     
    // store the record count reduced by the available samples, which 
    // can be consumed by the controlled transfer thread 
    lastRecordCount = currentRecordCount - availableSampleCount.get();
     
    // update time stamp 
    lastTimeStamp.set( timeStamp );
  } 
   
  /* 
   * (non-Javadoc) 
   *  
   * @see 
   * de.unikassel.android.sdcframework.transmission.facade.SampleRateChangeResponder 
   * #onSampleRateChanged()