question: public void obtain ( long timeout_ms ) throws IOException , InterruptedException , TimeoutException { Long quit_time = System . currentTimeMillis ( ) + timeout_ms ; if ( fileLock != null && fileLock . isValid ( ) ) { return ; } do { try { fileLock = fileToLock . tryLock ( ) ; return ; } catch ( OverlappingFileLockException e ) { Thread . sleep ( 1000 ) ; } } while ( System . currentTimeMillis ( ) < quit_time ) ; throw new TimeoutException ( ) ; }
target:  Locks the file, with a timeout (non-blocking).