[freenet-cvs] r15480 - trunk/freenet/src/freenet/node

toad at freenetproject.org toad at freenetproject.org
Mon Oct 22 19:07:40 UTC 2007


Author: toad
Date: 2007-10-22 19:07:40 +0000 (Mon, 22 Oct 2007)
New Revision: 15480

Modified:
   trunk/freenet/src/freenet/node/CHKInsertSender.java
Log:
Do the status check in finally. It is valid in all cases because we always set status.

Modified: trunk/freenet/src/freenet/node/CHKInsertSender.java
===================================================================
--- trunk/freenet/src/freenet/node/CHKInsertSender.java	2007-10-22 19:05:24 UTC (rev 15479)
+++ trunk/freenet/src/freenet/node/CHKInsertSender.java	2007-10-22 19:07:40 UTC (rev 15480)
@@ -209,31 +209,17 @@
         node.addInsertSender(myKey, origHTL, this);
         try {
         	realRun();
-        	int myStatus;
-        	synchronized(this) {
-        		myStatus = status;
-        	}
-        	if(myStatus == NOT_FINISHED) {
-        		Logger.error(this, "realRun() returned without setting status on "+this);
-        		finish(INTERNAL_ERROR, null); // Avoid deadlock
-        	}
 		} catch (OutOfMemoryError e) {
 			OOMHandler.handleOOM(e);
-            int myStatus;
-            synchronized (this) {
-				myStatus = status;
-			}
-            if(myStatus == NOT_FINISHED)
-            	finish(INTERNAL_ERROR, null);
         } catch (Throwable t) {
             Logger.error(this, "Caught "+t, t);
+        } finally {
             int myStatus;
             synchronized (this) {
 				myStatus = status;
 			}
             if(myStatus == NOT_FINISHED)
             	finish(INTERNAL_ERROR, null);
-        } finally {
         	node.removeInsertSender(myKey, origHTL, this);
         }
     }




More information about the cvs mailing list