AntPerformanceListener not thread safe?

Help
Anonymous
2012-08-24
2013-04-24

  • Anonymous
    2012-08-24

    I'm tried using "-listener net.sf.antcontrib.perf.AntPerformanceListener" with an ant script that uses <foreach>, and found the build consistently hung with threads here

    java.lang.Thread.State: RUNNABLE
    at java.util.HashMap.put(HashMap.java:374)
    at net.sf.antcontrib.perf.AntPerformanceListener.taskStarted(AntPerformanceListener.java:198)
    at org.apache.tools.ant.Project.fireTaskStarted(Project.java:2184)
    at org.apache.tools.ant.Task.perform(Task.java:344)
    at org.apache.tools.ant.Target.execute(Target.java:392)
    at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:180)
    at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:82)
    at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:393)
    at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)

    It seems likely that there is non-thread safe usage of Map targetStats and Map taskStats. 

     

  • Anonymous
    2012-08-24

    Using Collections.synchronizedMap() does seem to let me get through my build.  Not sure that it makes this Listener completely thread safe.