@ Nonnull public ESuccess writeLockedAtomic ( @ Nonnull final IThrowingRunnable < IOException > aRunnable ) throws IOException { m_aRWLock . writeLock ( ) . lock ( ) ; try { if ( isClosing ( ) ) { LOGGER . info ( "Cannot executed something write locked, because Lucene is shutting down" ) ; return ESuccess . FAILURE ; } aRunnable . run ( ) ; } finally { m_aRWLock . writeLock ( ) . unlock ( ) ; } return ESuccess . SUCCESS ; }
Run the provided action within a locked section .