Author: robert
Date: 2008-02-18 22:03:45 +0000 (Mon, 18 Feb 2008)
New Revision: 18052
Modified:
trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java
Log:
On second thought, just remove sync's on USMChecker.this (it's the only thread
that synchronizes to itself?);
Comments indicate EvilJVM bug will deadlock on syncing to the main object, so
don't do that (obsoletes r18050).
If there is some crazy side-effect (wanting the added cpu delay of locking),
that needs to be commented.
Modified: trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java
===================================================================
--- trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java 2008-02-18
21:35:39 UTC (rev 18051)
+++ trunk/freenet/src/freenet/io/comm/UdpSocketHandler.java 2008-02-18
22:03:45 UTC (rev 18052)
@@ -314,10 +314,9 @@
while(true) {
if(_isDone) {
boolean active;
- // Gone now, so we can safely
synchronize.
- synchronized(UdpSocketHandler.this) {
+ // Gone now, little reason to
synchronize; particularly for reading a primitive.
+ // The EvilJVM bug may deadlock on
proper synchronization here anyway.
active = _active;
- }
if(active) {
System.err.println("UdpSocketHandler for port "+listenPort+" has died without
being told to! Restarting node...");
if(node.isUsingWrapper()){
@@ -374,10 +373,6 @@
}
} else {
if(_isDone) return;
- // Final check
- synchronized(this) {
- if(_isDone) return;
- }
Logger.error(this, "MAIN LOOP
TERMINATED");
System.err.println("MAIN LOOP
TERMINATED!");
node.exit(NodeInitException.EXIT_MAIN_LOOP_LOST);