public Optional < Scoped > tryAcquirePersistingLock ( long inodeId ) { AtomicBoolean lock = mPersistingLocks . getUnchecked ( inodeId ) ; if ( lock . compareAndSet ( false , true ) ) { return Optional . of ( ( ) -> lock . set ( false ) ) ; } return Optional . empty ( ) ; }
Tries to acquire a lock for persisting the specified inode id .