You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by da...@apache.org on 2011/07/26 16:03:11 UTC

svn commit: r1151101 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/BasicDaemon.java

Author: dag
Date: Tue Jul 26 14:03:10 2011
New Revision: 1151101

URL: http://svn.apache.org/viewvc?rev=1151101&view=rev
Log:
DERBY-5333 Intermittent assert failure in testInterruptShutdown: thread's interrupted flag lost after shutdown

Patch derby-5333a fixes two instances where we neglected to note that
an interrupt had occured while in a wait call. They were missed during
the first code inspection because they appeared to be part of daemon
code from a superficial inspection, but the code was in fact called by
session threads (for which we expect interrupts).


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/BasicDaemon.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/BasicDaemon.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/BasicDaemon.java?rev=1151101&r1=1151100&r2=1151101&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/BasicDaemon.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/daemon/BasicDaemon.java Tue Jul 26 14:03:10 2011
@@ -33,6 +33,7 @@ import org.apache.derby.iapi.error.Stand
 
 import java.util.Vector;
 import java.util.List;
+import org.apache.derby.iapi.util.InterruptStatus;
 
 /**
 	A BasicDaemon is a background worker thread which does asynchronous I/O and
@@ -441,7 +442,7 @@ public class BasicDaemon implements Daem
 				}
 				catch (InterruptedException ie)				
 				{
-					// someone interrrupt us, done running
+                    InterruptStatus.setInterrupted();
 				}
 			}
 		}
@@ -522,8 +523,8 @@ public class BasicDaemon implements Daem
 						wait();
 					}catch (InterruptedException ie)
 					{
-						// someone interrupt us, see what's going on
-					}
+                        InterruptStatus.setInterrupted();
+                    }
 				}
 			}
 		}