[MNG-6471] Parallel builder should use the module name as thread name

This closes #177
This commit is contained in:
Romain Manni-Bucau 2018-09-06 11:08:14 +02:00 committed by Michael Osipov
parent 5060349e67
commit f32c3dba94
1 changed files with 16 additions and 5 deletions

View File

@ -186,12 +186,23 @@ public class MultiThreadedBuilder
{ {
public ProjectSegment call() public ProjectSegment call()
{ {
// muxer.associateThreadWithProjectSegment( projectBuild ); final Thread currentThread = Thread.currentThread();
lifecycleModuleBuilder.buildProject( projectBuild.getSession(), rootSession, reactorContext, final String originalThreadName = currentThread.getName();
projectBuild.getProject(), taskSegment ); currentThread.setName( "mvn-builder-" + projectBuild.getProject().getId() );
// muxer.setThisModuleComplete( projectBuild );
return projectBuild; try
{
// muxer.associateThreadWithProjectSegment( projectBuild );
lifecycleModuleBuilder.buildProject( projectBuild.getSession(), rootSession, reactorContext,
projectBuild.getProject(), taskSegment );
// muxer.setThisModuleComplete( projectBuild );
return projectBuild;
}
finally
{
currentThread.setName( originalThreadName );
}
} }
}; };
} }