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 ka...@apache.org on 2010/06/26 19:50:15 UTC

svn commit: r958257 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks: ConcurrentLockSet.java LockSet.java

Author: kahatlen
Date: Sat Jun 26 17:50:14 2010
New Revision: 958257

URL: http://svn.apache.org/viewvc?rev=958257&view=rev
Log:
DERBY-4711: Hung thread after another thread is interrupted

Added some comments to explain the fix.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java?rev=958257&r1=958256&r2=958257&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/ConcurrentLockSet.java Sat Jun 26 17:50:14 2010
@@ -468,6 +468,10 @@ forever:	for (;;) {
                     try {
                         wakeupReason = waitingLock.waitForGrant(actualTimeout);
                     } catch(StandardException e) {
+                        // DERBY-4711: If waitForGrant() fails, we need to
+                        // remove ourselves from the queue so that those
+                        // behind us in the queue don't get stuck waiting for
+                        // us.
                         nextWaitingLock = control.getNextWaiter(waitingLock, true, this);
                         throw e;
                     }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.java?rev=958257&r1=958256&r2=958257&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks/LockSet.java Sat Jun 26 17:50:14 2010
@@ -281,6 +281,10 @@ forever:	for (;;) {
                     try {
                         wakeupReason = waitingLock.waitForGrant(actualTimeout);
                     } catch(StandardException e) {
+                        // DERBY-4711: If waitForGrant() fails, we need to
+                        // remove ourselves from the queue so that those
+                        // behind us in the queue don't get stuck waiting for
+                        // us.
                         nextWaitingLock = control.getNextWaiter(waitingLock, true, this);
                         throw e;
                     }