/hg/icedtea-web: Fix concurrent access problem to downloadOptions.

dlila at icedtea.classpath.org dlila at icedtea.classpath.org
Tue Apr 5 09:35:27 PDT 2011


changeset 9c89214b7ef6 in /hg/icedtea-web
details: http://icedtea.classpath.org/hg/icedtea-web?cmd=changeset;node=9c89214b7ef6
author: Denis Lila <dlila at redhat.com>
date: Tue Apr 05 12:39:14 2011 -0400

	Fix concurrent access problem to downloadOptions.


diffstat:

 ChangeLog                                            |  6 ++++++
 netx/net/sourceforge/jnlp/cache/ResourceTracker.java |  7 +++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 62011060e7ea -r 9c89214b7ef6 ChangeLog
--- a/ChangeLog	Tue Apr 05 12:07:10 2011 -0400
+++ b/ChangeLog	Tue Apr 05 12:39:14 2011 -0400
@@ -1,3 +1,9 @@
+2011-04-05  Denis Lila  <dlila at redhat.com>
+
+	* netx/net/sourceforge/jnlp/cache/ResourceTracker.java:
+	Remove unused imports, add import.
+	(downloadOptions): Make ConcurrentHashMap.
+
 2011-04-05  Denis Lila  <dlila at redhat.com>
 
 	* plugin/icedteanp/IcedTeaNPPlugin.cc
diff -r 62011060e7ea -r 9c89214b7ef6 netx/net/sourceforge/jnlp/cache/ResourceTracker.java
--- a/netx/net/sourceforge/jnlp/cache/ResourceTracker.java	Tue Apr 05 12:07:10 2011 -0400
+++ b/netx/net/sourceforge/jnlp/cache/ResourceTracker.java	Tue Apr 05 12:39:14 2011 -0400
@@ -29,9 +29,8 @@
 import java.net.URL;
 import java.net.URLConnection;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.jar.JarOutputStream;
 import java.util.jar.Pack200;
 import java.util.jar.Pack200.Unpacker;
@@ -120,8 +119,8 @@
     /** resources requested to be downloaded */
     private static ArrayList<Resource> queue = new ArrayList<Resource>();
 
-    private static Map<Resource, DownloadOptions> downloadOptions =
-        new HashMap<Resource, DownloadOptions>();
+    private static ConcurrentHashMap<Resource, DownloadOptions> downloadOptions =
+        new ConcurrentHashMap<Resource, DownloadOptions>();
 
     /** resource trackers threads are working for (used for load balancing across multi-tracker downloads) */
     private static ArrayList<ResourceTracker> active =



More information about the distro-pkg-dev mailing list