[freenet-cvs] r11234 - trunk/freenet/src/freenet/io/comm

cvs at freenetproject.org cvs at freenetproject.org
Tue Dec 5 18:33:03 UTC 2006


Author: nextgens
Date: 2006-12-05 15:36:34 +0000 (Tue, 05 Dec 2006)
New Revision: 11234

Modified:
   trunk/freenet/src/freenet/io/comm/UdpSocketManager.java
Log:
Remove unnecessary synchronization on USM... and force LinkedLists to be final


Modified: trunk/freenet/src/freenet/io/comm/UdpSocketManager.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/UdpSocketManager.java	2006-12-05 15:21:31 UTC (rev 11233)
+++ trunk/freenet/src/freenet/io/comm/UdpSocketManager.java	2006-12-05 15:36:34 UTC (rev 11234)
@@ -38,10 +38,10 @@
 	public static final String VERSION = "$Id: UdpSocketManager.java,v 1.22 2005/08/25 17:28:19 amphibian Exp $";
 	private static boolean logMINOR; 
 	private Dispatcher _dispatcher;
-	private DatagramSocket _sock;
+	private final DatagramSocket _sock;
 	/** _filters serves as lock for both */
-	private LinkedList _filters = new LinkedList();
-	private LinkedList _unclaimed = new LinkedList();
+	private final LinkedList _filters = new LinkedList();
+	private final LinkedList _unclaimed = new LinkedList();
 	private int _dropProbability;
 	private LowLevelFilter lowLevelFilter;
 	/** RNG for debugging, used with _dropProbability.
@@ -682,9 +682,7 @@
 	 * @return the number of received messages that are currently unclaimed
 	 */
 	public int getUnclaimedFIFOSize() {
-		synchronized(_filters) { // FIXME unnecessary synch?
-			return _unclaimed.size();
-		}
+		return _unclaimed.size();
 	}
 	
 	public Map getUnclaimedFIFOMessageCounts() {




More information about the cvs mailing list