final public void decrementWithSyncFlag ( long curTime , long val ) { if ( enabled ) { lastSampleTime = updateIntegral ( curTime ) ; if ( sync ) { synchronized ( this ) { current -= val ; } } else { current -= val ; // to eliminate negative numbers if ( current < 0 ) current = 0 ; } updateWaterMark ( ) ; } else { current -= val ; } }
synchronize ONLY if synchronized update flag is enabled