leosutic 2003/04/02 01:24:44
Modified: compatibility/src/java/org/apache/avalon/excalibur/concurrent
ReadWriteLock.java
Log:
Added two methods required for proper testing (had to avoid a race
condition).
Revision Changes Path
1.7 +19 -1
avalon-excalibur/compatibility/src/java/org/apache/avalon/excalibur/concurrent/ReadWriteLock.java
Index: ReadWriteLock.java
===================================================================
RCS file:
/home/cvs/avalon-excalibur/compatibility/src/java/org/apache/avalon/excalibur/concurrent/ReadWriteLock.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- ReadWriteLock.java 1 Apr 2003 07:33:59 -0000 1.6
+++ ReadWriteLock.java 2 Apr 2003 09:24:44 -0000 1.7
@@ -252,4 +252,22 @@
{
return tryAcquireWrite();
}
+
+ //
+ // Methods used for unit tests
+ //
+
+ /**
+ * Returns the number of read locks held.
+ */
+ protected synchronized int getNumReadLocksHeld() {
+ return m_numReadLocksHeld;
+ }
+
+ /**
+ * Returns the number of write locks held.
+ */
+ protected synchronized int getNumWaitingForWrite() {
+ return m_numWaitingForWrite;
+ }
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]