jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pmoua...@apache.org
Subject svn commit: r1208829 - /jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportActionRouter.java
Date Wed, 30 Nov 2011 22:04:09 GMT
Author: pmouawad
Date: Wed Nov 30 22:04:09 2011
New Revision: 1208829

URL: http://svn.apache.org/viewvc?rev=1208829&view=rev
Log:
Fixed potential double init if method is called concurrently

Modified:
    jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportActionRouter.java

Modified: jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportActionRouter.java
URL: http://svn.apache.org/viewvc/jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportActionRouter.java?rev=1208829&r1=1208828&r2=1208829&view=diff
==============================================================================
--- jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportActionRouter.java (original)
+++ jmeter/trunk/src/reports/org/apache/jmeter/report/gui/action/ReportActionRouter.java Wed
Nov 30 22:04:09 2011
@@ -46,6 +46,8 @@ public final class ReportActionRouter im
 
     private static final Logger log = LoggingManager.getLoggerForClass();
 
+	private static final Object LOCK = new Object();
+
     private Map<String, HashSet<ActionListener>> preActionListeners =
         new HashMap<String, HashSet<ActionListener>>();
 
@@ -299,8 +301,12 @@ public final class ReportActionRouter im
      */
     public static ReportActionRouter getInstance() {
         if (router == null) {
-            router = new ReportActionRouter();
-            router.populateCommandMap();
+        	synchronized (LOCK) {
+        		if(router == null) {
+	                router = new ReportActionRouter();
+	                router.populateCommandMap();				
+        		}
+			}
         }
         return router;
     }



Mime
View raw message