db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r957902 - in /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/locks: ConcurrentLockSet.java LockSet.java
Date Fri, 25 Jun 2010 11:52:32 GMT
Author: kahatlen
Date: Fri Jun 25 11:52:31 2010
New Revision: 957902

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

If a thread fails while waiting for a lock, remove that thread from
the queue.

Patch contributed by Luke Quinane <luke@nuix.com>.

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=957902&r1=957901&r2=957902&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
Fri Jun 25 11:52:31 2010
@@ -460,12 +460,18 @@ final class ConcurrentLockSet implements
 
 forever:	for (;;) {
 
-                byte wakeupReason = waitingLock.waitForGrant(actualTimeout);
-                
+                byte wakeupReason = 0;
                 ActiveLock nextWaitingLock = null;
                 Object[] deadlockData = null;
 
                 try {
+                    try {
+                        wakeupReason = waitingLock.waitForGrant(actualTimeout);
+                    } catch(StandardException e) {
+                        nextWaitingLock = control.getNextWaiter(waitingLock, true, this);
+                        throw e;
+                    }
+
                     boolean willQuitWait;
                     Enumeration timeoutLockTable = null;
                     long currentTime = 0;

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=957902&r1=957901&r2=957902&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 Fri
Jun 25 11:52:31 2010
@@ -273,12 +273,18 @@ final class LockSet implements LockTable
 
 forever:	for (;;) {
 
-                byte wakeupReason = waitingLock.waitForGrant(actualTimeout);
-                
+                byte wakeupReason = 0;
                 ActiveLock nextWaitingLock = null;
                 Object[] deadlockData = null;
 
                 try {
+                    try {
+                        wakeupReason = waitingLock.waitForGrant(actualTimeout);
+                    } catch(StandardException e) {
+                        nextWaitingLock = control.getNextWaiter(waitingLock, true, this);
+                        throw e;
+                    }
+
                     boolean willQuitWait;
                     Enumeration timeoutLockTable = null;
                     long currentTime = 0;



Mime
View raw message