manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1646640 - in /manifoldcf/trunk: CHANGES.txt framework/core/src/main/java/org/apache/manifoldcf/core/lockmanager/LockGate.java
Date Fri, 19 Dec 2014 07:25:27 GMT
Author: kwright
Date: Fri Dec 19 07:25:26 2014
New Revision: 1646640

URL: http://svn.apache.org/r1646640
Log:
Fix for CONNECTORS-1126.

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/lockmanager/LockGate.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1646640&r1=1646639&r2=1646640&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Fri Dec 19 07:25:26 2014
@@ -3,6 +3,8 @@ $Id$
 
 ======================= 2.1-dev =====================
 
+CONNECTORS-1126: Fix LockGate release logic to not flush LockGate
+objects so aggressively.
 
 ======================= Release 2.0 =====================
 

Modified: manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/lockmanager/LockGate.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/lockmanager/LockGate.java?rev=1646640&r1=1646639&r2=1646640&view=diff
==============================================================================
--- manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/lockmanager/LockGate.java
(original)
+++ manifoldcf/trunk/framework/core/src/main/java/org/apache/manifoldcf/core/lockmanager/LockGate.java
Fri Dec 19 07:25:26 2014
@@ -106,7 +106,7 @@ public class LockGate
   
   public void makeInvalid()
   {
-    synchronized (lockObject)
+    synchronized (this)
     {
       this.lockPool = null;
       lockObject.makeInvalid();
@@ -199,12 +199,12 @@ public class LockGate
   public void leaveWriteLock()
     throws ManifoldCFException, InterruptedException, ExpiredObjectException
   {
-    synchronized (lockObject)
+    synchronized (this)
     {
       // Leave, and if we succeed, flush from pool.
       if (lockObject.leaveWriteLock())
       {
-        if (lockPool != null)
+        if (threadRequests.size() == 0 && lockPool != null)
           lockPool.releaseObject(lockKey, this);
       }
     }
@@ -241,12 +241,12 @@ public class LockGate
   public void leaveNonExWriteLock()
     throws ManifoldCFException, InterruptedException, ExpiredObjectException
   {
-    synchronized (lockObject)
+    synchronized (this)
     {
       // Leave, and if we succeed, flush from pool.
       if (lockObject.leaveNonExWriteLock())
       {
-        if (lockPool != null)
+        if (threadRequests.size() == 0 && lockPool != null)
           lockPool.releaseObject(lockKey, this);
       }
     }
@@ -283,12 +283,12 @@ public class LockGate
   public void leaveReadLock()
     throws ManifoldCFException, InterruptedException, ExpiredObjectException
   {
-    // Leave, and if we succeed, flush from pool.
-    synchronized (lockObject)
+    // Leave, and if we succeed (and the thread queue is empty), flush from pool.
+    synchronized (this)
     {
       if (lockObject.leaveReadLock())
       {
-        if (lockPool != null)
+        if (threadRequests.size() == 0 && lockPool != null)
           lockPool.releaseObject(lockKey, this);
       }
     }



Mime
View raw message