public static void logBeforeExit ( ExitLogger logger ) { try { if ( logged . compareAndSet ( false , true ) ) { logger . logExit ( ) ; } } catch ( Throwable ignored ) { // ignored } }
Invokes the exit logger if and only if no ExitLogger was previously invoked .