public static void limitLife ( final long lifetimeMs ) { new Thread ( ( ) -> { CommonUtils . sleepMs ( lifetimeMs ) ; LOG . info ( "Process has timed out after {}ms, exiting now" , lifetimeMs ) ; System . exit ( - 1 ) ; } , "life-limiter" ) . start ( ) ; }
Launches a thread to terminate the current process after the specified period has elapsed .