jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: deadlock problem
Date Mon, 28 Nov 2005 19:25:43 GMT
just found out that the patch doesn't work.

if you are still interested in testing, try the following:

Index: SharedItemStateManager.java
===================================================================
--- SharedItemStateManager.java	(revision 349402)
+++ SharedItemStateManager.java	(working copy)
@@ -144,7 +144,16 @@
       * Read-/Write-Lock to synchronize access on this item state manager.
       */
      private final ReadWriteLock rwLock =
-            new ReentrantWriterPreferenceReadWriteLock();
+            new ReentrantWriterPreferenceReadWriteLock() {
+                /**
+                 * Allow reader when there is no active writer, or current
+                 * thread owns the write lock (reentrant).
+                 */
+                protected boolean allowReader() {
+                    return activeWriter_ == null ||
+                      activeWriter_ == Thread.currentThread();
+                }
+            };

      /**
       * Creates a new <code>SharedItemStateManager</code> instance.


I will do some further tests and commit the change when it turns out to 
be stable and ok.

regards
  marcel


Brian Moseley wrote:
> Marcel Reutegger wrote:
> 
>> hmm, I had another look at the thread dumps and the problem is indeed 
>> the ReentrantWriterPreferenceReadWriteLock as you indicated in your 
>> first post.
> 
> 
> wonderful. i'm happy to learn that i was not imagining things :)
> 
>> He is my suggested change:
> 
> 
> i'll give it a go myself once i get into the office.



Mime
View raw message