gnodet commented on issue #12585:
URL: https://github.com/apache/maven/issues/12585#issuecomment-5457539820

   Closing as invalid after investigation.
   
   `MavenSession.currentProject` is already a `ThreadLocal<MavenProject>` (line 
65 of `MavenSession.java`), meaning `setCurrentProject()` calls 
`this.currentProject.set(...)`, which is inherently thread-safe — each thread 
gets its own copy.
   
   `BuildPlanExecutor.attachToThread()` calls 
`session.setCurrentProject(step.project)` from executor threads, but since the 
underlying field is a `ThreadLocal`, concurrent calls from different executor 
threads each write to their own thread-local storage. This is the correct 
pattern for concurrent Maven builds and is thread-safe by design.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to