You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/05/30 07:55:16 UTC

[GitHub] [maven] gnodet commented on a diff in pull request #736: [3.8.x] [MNG-7476] Display a warning when an aggregator mojo locks other mojos executions

gnodet commented on code in PR #736:
URL: https://github.com/apache/maven/pull/736#discussion_r884527568


##########
maven-core/src/main/java/org/apache/maven/lifecycle/internal/MojoExecutor.java:
##########
@@ -220,20 +223,44 @@ private void execute( MavenSession session, MojoExecution mojoExecution, Project
      * TODO: ideally, the builder should take care of the ordering in a smarter way
      * TODO: and concurrency issues fixed with MNG-7157
      */
-    private static class ProjectLock implements AutoCloseable
+    private class ProjectLock implements AutoCloseable
     {
         final Lock acquiredAggregatorLock;
-        final Lock acquiredProjectLock;
+        final OwnerReentrantLock acquiredProjectLock;
 
-        ProjectLock( MavenSession session, MojoDescriptor mojoDescriptor, ReadWriteLock aggregatorLock )
+        ProjectLock( MavenSession session, MojoDescriptor mojoDescriptor )
         {
+            mojos.put( Thread.currentThread(), mojoDescriptor );

Review Comment:
   You're right.  I'll remove the access to the `mojos` map in the caller method and will add the corresponding removal from the map in the `close` method of the `ProjectLock`.  This way, only the `ProjectLock` class will actually access the map.



-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org