private int incrementReferenceCounter ( final JobID jobID ) { while ( true ) { AtomicInteger ai = this . libraryReferenceCounter . get ( jobID ) ; if ( ai == null ) { ai = new AtomicInteger ( 1 ) ; if ( this . libraryReferenceCounter . putIfAbsent ( jobID , ai ) == null ) { return 1 ; } // We had a race, try again } else { return ai . incrementAndGet ( ) ; } } }
Increments the reference counter for the library manager entry with the given job ID .