Give the Service Threads Names.

This commit is contained in:
AlgorithmX2 2014-01-01 03:01:58 -06:00
parent 587fb893b4
commit 084fcf7d44

View file

@ -98,6 +98,13 @@ public class AppEng
return integrationModules.getInstance( Name ); return integrationModules.getInstance( Name );
} }
private void startService(String serviceName, Thread thread)
{
thread.setName( serviceName );
thread.setPriority( Thread.MIN_PRIORITY );
thread.start();
}
@EventHandler @EventHandler
void PreInit(FMLPreInitializationEvent event) void PreInit(FMLPreInitializationEvent event)
{ {
@ -116,13 +123,13 @@ public class AppEng
if ( Configuration.instance.isFeatureEnabled( AEFeature.Profiler ) ) if ( Configuration.instance.isFeatureEnabled( AEFeature.Profiler ) )
{ {
AELog.info( "Starting Profiler" ); AELog.info( "Starting Profiler" );
(new Thread( Profiler.instance = new Profiler() )).start(); startService( "AE2 Profiler", (new Thread( Profiler.instance = new Profiler() )) );
} }
if ( Configuration.instance.isFeatureEnabled( AEFeature.VersionChecker ) ) if ( Configuration.instance.isFeatureEnabled( AEFeature.VersionChecker ) )
{ {
AELog.info( "Starting VersionChecker" ); AELog.info( "Starting VersionChecker" );
(new Thread( VersionChecker.instance = new VersionChecker() )).start(); startService( "AE2 VersionChecker", new Thread( VersionChecker.instance = new VersionChecker() ) );
} }
AELog.info( "PreInit ( end )" ); AELog.info( "PreInit ( end )" );