polygene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paulmer...@apache.org
Subject [06/19] zest-java git commit: locking: remove workaround for old HotSpot bug fixed in h17(b06)
Date Sat, 24 Dec 2016 10:29:18 GMT
locking: remove workaround for old HotSpot bug fixed in h17(b06)

See http://bugs.java.com/bugdatabase/view_bug.do?bug_id=6822370
That’s Java 6 something


Project: http://git-wip-us.apache.org/repos/asf/zest-java/repo
Commit: http://git-wip-us.apache.org/repos/asf/zest-java/commit/3565bcba
Tree: http://git-wip-us.apache.org/repos/asf/zest-java/tree/3565bcba
Diff: http://git-wip-us.apache.org/repos/asf/zest-java/diff/3565bcba

Branch: refs/heads/develop
Commit: 3565bcba7bcf2e4ad62a96c8daff72178c3e9d1a
Parents: 1fc02df
Author: Paul Merlin <paulmerlin@apache.org>
Authored: Sun Dec 18 00:32:03 2016 +0100
Committer: Paul Merlin <paulmerlin@apache.org>
Committed: Sun Dec 18 00:33:36 2016 +0100

----------------------------------------------------------------------
 .../library/locking/WriteLockConcern.java       | 32 ++------------------
 1 file changed, 2 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zest-java/blob/3565bcba/libraries/locking/src/main/java/org/apache/polygene/library/locking/WriteLockConcern.java
----------------------------------------------------------------------
diff --git a/libraries/locking/src/main/java/org/apache/polygene/library/locking/WriteLockConcern.java
b/libraries/locking/src/main/java/org/apache/polygene/library/locking/WriteLockConcern.java
index 53fd4e6..c9b632b 100644
--- a/libraries/locking/src/main/java/org/apache/polygene/library/locking/WriteLockConcern.java
+++ b/libraries/locking/src/main/java/org/apache/polygene/library/locking/WriteLockConcern.java
@@ -21,7 +21,6 @@ package org.apache.polygene.library.locking;
 
 import java.lang.reflect.InvocationHandler;
 import java.lang.reflect.Method;
-import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReadWriteLock;
 import org.apache.polygene.api.common.AppliesTo;
@@ -32,20 +31,17 @@ import org.apache.polygene.api.injection.scope.This;
  * Applies write-lock to Composite
  */
 @AppliesTo( WriteLock.class )
-public class WriteLockConcern
-    extends ConcernOf<InvocationHandler>
+public class WriteLockConcern extends ConcernOf<InvocationHandler>
     implements InvocationHandler
 {
-    private
     @This
-    ReadWriteLock lock;
+    private ReadWriteLock lock;
 
     @Override
     public Object invoke( Object o, Method method, Object[] objects )
         throws Throwable
     {
         Lock writeLock = lock.writeLock();
-        lock(writeLock);
         try
         {
             return next.invoke( o, method, objects );
@@ -55,28 +51,4 @@ public class WriteLockConcern
             writeLock.unlock();
         }
     }
-
-    /**
-     * Fix for this bug:
-     * http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6822370
-     */
-    protected void lock(Lock lock)
-    {
-        while(true)
-        {
-            try
-            {
-                //noinspection StatementWithEmptyBody
-                while( !lock.tryLock( 1000, TimeUnit.MILLISECONDS ) )
-                {
-                    // On timeout, try again
-                }
-                return; // Finally got a lock
-            }
-            catch( InterruptedException e )
-            {
-                // Try again
-            }
-        }
-    }
 }
\ No newline at end of file


Mime
View raw message