@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;
  }
@ 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.

@param aRunnable
Callback to be executed
@return {@link ESuccess#FAILURE} if the index is just closing
@throws IOException
may be thrown by the callback