Return-Path: Delivered-To: apmail-jackrabbit-commits-archive@www.apache.org Received: (qmail 90927 invoked from network); 29 Nov 2010 12:54:00 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 29 Nov 2010 12:54:00 -0000 Received: (qmail 58036 invoked by uid 500); 29 Nov 2010 12:54:00 -0000 Delivered-To: apmail-jackrabbit-commits-archive@jackrabbit.apache.org Received: (qmail 57973 invoked by uid 500); 29 Nov 2010 12:53:59 -0000 Mailing-List: contact commits-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@jackrabbit.apache.org Delivered-To: mailing list commits@jackrabbit.apache.org Received: (qmail 57962 invoked by uid 99); 29 Nov 2010 12:53:59 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Nov 2010 12:53:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Nov 2010 12:53:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5EB7F2388994; Mon, 29 Nov 2010 12:52:23 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1040094 - in /jackrabbit/branches/2.2: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/ jackrabbit-jcr-servlet/ test/compatibility/create11/ test/compatibility/create12/ test/compatibility/create13/ test/compatibility/cre... Date: Mon, 29 Nov 2010 12:52:23 -0000 To: commits@jackrabbit.apache.org From: jukka@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101129125223.5EB7F2388994@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jukka Date: Mon Nov 29 12:52:22 2010 New Revision: 1040094 URL: http://svn.apache.org/viewvc?rev=1040094&view=rev Log: 2.2: Merged revision 1040090 (JCR-2820) Modified: jackrabbit/branches/2.2/ (props changed) jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/FineGrainedISMLocking.java jackrabbit/branches/2.2/jackrabbit-jcr-servlet/ (props changed) jackrabbit/branches/2.2/test/compatibility/create11/ (props changed) jackrabbit/branches/2.2/test/compatibility/create12/ (props changed) jackrabbit/branches/2.2/test/compatibility/create13/ (props changed) jackrabbit/branches/2.2/test/compatibility/create14/ (props changed) jackrabbit/branches/2.2/test/compatibility/create15/ (props changed) jackrabbit/branches/2.2/test/compatibility/create16/ (props changed) jackrabbit/branches/2.2/test/compatibility/create20/ (props changed) jackrabbit/branches/2.2/test/compatibility/create21/ (props changed) Propchange: jackrabbit/branches/2.2/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Nov 29 12:52:22 2010 @@ -2,4 +2,4 @@ /jackrabbit/sandbox/JCR-1456:774917-886178 /jackrabbit/sandbox/JCR-2170:812417-816332 /jackrabbit/sandbox/tripod-JCR-2209:795441-795863 -/jackrabbit/trunk:1038201,1038203,1038205,1038657,1039064,1039347,1039408,1039422-1039423,1039888,1039946,1040033 +/jackrabbit/trunk:1038201,1038203,1038205,1038657,1039064,1039347,1039408,1039422-1039423,1039888,1039946,1040033,1040090 Modified: jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/FineGrainedISMLocking.java URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/FineGrainedISMLocking.java?rev=1040094&r1=1040093&r2=1040094&view=diff ============================================================================== --- jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/FineGrainedISMLocking.java (original) +++ jackrabbit/branches/2.2/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/state/FineGrainedISMLocking.java Mon Nov 29 12:52:22 2010 @@ -16,6 +16,9 @@ */ package org.apache.jackrabbit.core.state; +import static org.apache.jackrabbit.core.TransactionContext.getCurrentThreadId; +import static org.apache.jackrabbit.core.TransactionContext.isSameThreadId; + import java.util.Collections; import java.util.HashMap; import java.util.Iterator; @@ -52,7 +55,7 @@ public class FineGrainedISMLocking imple */ private WriteLockImpl activeWriter; - private volatile Thread activeWriterThread; + private volatile Object activeWriterId; private ReadWriteLock writerStateRWLock = new WriterPreferenceReadWriteLock(); @@ -79,7 +82,7 @@ public class FineGrainedISMLocking imple */ public ReadLock acquireReadLock(ItemId id) throws InterruptedException { - if (activeWriterThread == Thread.currentThread()) { + if (isSameThreadId(activeWriterId, getCurrentThreadId())) { // we hold the write lock readLockMap.addLock(id); return new ReadLockImpl(id); @@ -126,7 +129,7 @@ public class FineGrainedISMLocking imple if (activeWriter == null && !readLockMap.hasDependency(changeLog)) { activeWriter = new WriteLockImpl(changeLog); - activeWriterThread = Thread.currentThread(); + activeWriterId = getCurrentThreadId(); return activeWriter; } else { signal = new Latch(); @@ -164,7 +167,7 @@ public class FineGrainedISMLocking imple } try { activeWriter = null; - activeWriterThread = null; + activeWriterId = null; notifyWaitingReaders(); notifyWaitingWriters(); } finally { @@ -186,7 +189,6 @@ public class FineGrainedISMLocking imple } try { activeWriter = null; - activeWriterThread = null; // only notify waiting readers since we still hold a down // graded lock, which is kind of exclusiv with respect to // other writers @@ -224,7 +226,7 @@ public class FineGrainedISMLocking imple } try { readLockMap.removeLock(id); - if (activeWriterThread != Thread.currentThread()) { + if (!isSameThreadId(activeWriterId, getCurrentThreadId())) { // only notify waiting writers if we do *not* hold a write // lock at the same time. that would be a waste of cpu time. notifyWaitingWriters(); Propchange: jackrabbit/branches/2.2/jackrabbit-jcr-servlet/ ('svn:mergeinfo' removed) Propchange: jackrabbit/branches/2.2/test/compatibility/create11/ ('svn:mergeinfo' removed) Propchange: jackrabbit/branches/2.2/test/compatibility/create12/ ('svn:mergeinfo' removed) Propchange: jackrabbit/branches/2.2/test/compatibility/create13/ ('svn:mergeinfo' removed) Propchange: jackrabbit/branches/2.2/test/compatibility/create14/ ('svn:mergeinfo' removed) Propchange: jackrabbit/branches/2.2/test/compatibility/create15/ ('svn:mergeinfo' removed) Propchange: jackrabbit/branches/2.2/test/compatibility/create16/ ('svn:mergeinfo' removed) Propchange: jackrabbit/branches/2.2/test/compatibility/create20/ ('svn:mergeinfo' removed) Propchange: jackrabbit/branches/2.2/test/compatibility/create21/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Nov 29 12:52:22 2010 @@ -1 +1 @@ -/jackrabbit/trunk/test/compatibility/create21:1038201,1038203,1038205,1038657,1039064,1039347,1039408,1039422-1039423,1039888,1039946,1040033 +/jackrabbit/trunk/test/compatibility/create21:1038201,1038203,1038205,1038657,1039064,1039347,1039408,1039422-1039423,1039888,1039946,1040033,1040090