You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by le...@apache.org on 2002/05/14 18:06:07 UTC
cvs commit: jakarta-avalon-excalibur/concurrent/src/java/org/apache/avalon/excalibur/concurrent ReadWriteLock.java
leosutic 02/05/14 09:06:07
Modified: concurrent/src/java/org/apache/avalon/excalibur/concurrent
ReadWriteLock.java
Log:
Fixed spelling error aquire -> acquire
Revision Changes Path
1.10 +48 -13 jakarta-avalon-excalibur/concurrent/src/java/org/apache/avalon/excalibur/concurrent/ReadWriteLock.java
Index: ReadWriteLock.java
===================================================================
RCS file: /home/cvs/jakarta-avalon-excalibur/concurrent/src/java/org/apache/avalon/excalibur/concurrent/ReadWriteLock.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ReadWriteLock.java 22 Mar 2002 08:53:40 -0000 1.9
+++ ReadWriteLock.java 14 May 2002 16:06:07 -0000 1.10
@@ -10,16 +10,16 @@
/**
* Class implementing a read/write lock. The lock has three states -
* unlocked, locked for reading and locked for writing. If the lock
- * is unlocked, anyone can aquire a read or write lock. If the lock
- * is locked for reading, anyone can aquire a read lock, but no one
- * can aquire a write lock. If the lock is locked for writing, no one
+ * is unlocked, anyone can acquire a read or write lock. If the lock
+ * is locked for reading, anyone can acquire a read lock, but no one
+ * can acquire a write lock. If the lock is locked for writing, no one
* can quire any type of lock.
* <p>
- * When the lock is released, those threads attempting to aquire a write lock
+ * When the lock is released, those threads attempting to acquire a write lock
* will take priority over those trying to get a read lock.
*
* @author <a href="mailto:leo.sutic@inspireinfrastructure.com">Leo Sutic</a>
- * @version CVS $Revision: 1.9 $ $Date: 2002/03/22 08:53:40 $
+ * @version CVS $Revision: 1.10 $ $Date: 2002/05/14 16:06:07 $
* @since 4.0
*/
public class ReadWriteLock
@@ -47,13 +47,13 @@
}
/**
- * Attempts to aquire a read lock. If no lock could be aquired
+ * Attempts to acquire a read lock. If no lock could be acquired
* the thread will wait until it can be obtained.
*
* @throws InterruptedException if the thread is interrupted while waiting for
* a lock.
*/
- public void aquireRead()
+ public void acquireRead()
throws InterruptedException
{
synchronized( m_lock )
@@ -67,13 +67,23 @@
}
/**
- * Attempts to aquire a write lock. If no lock could be aquired
+ * @deprecated It's spelled <code>a<b>c</b>quire</code>...
+ */
+ public void aquireRead()
+ throws InterruptedException
+ {
+ acquireRead ();
+ }
+
+
+ /**
+ * Attempts to acquire a write lock. If no lock could be acquired
* the thread will wait until it can be obtained.
*
* @throws InterruptedException if the thread is interrupted while waiting for
* a lock.
*/
- public void aquireWrite()
+ public void acquireWrite()
throws InterruptedException
{
synchronized( m_lock )
@@ -95,6 +105,15 @@
}
/**
+ * @deprecated It's spelled <code>a<b>c</b>quire</code>...
+ */
+ public void aquireWrite()
+ throws InterruptedException
+ {
+ acquireWrite ();
+ }
+
+ /**
* Releases a lock. This method will release both types of locks.
*
* @throws IllegalStateException when an attempt is made to release
@@ -123,11 +142,11 @@
}
/**
- * Attempts to aquire a read lock. This method returns immediately.
+ * Attempts to acquire a read lock. This method returns immediately.
*
* @return <code>true</code> iff the lock was successfully obtained.
*/
- public boolean tryAquireRead()
+ public boolean tryAcquireRead()
{
synchronized( m_lock )
{
@@ -142,13 +161,21 @@
}
}
}
+
+ /**
+ * @deprecated It's spelled <code>a<b>c</b>quire</code>...
+ */
+ public boolean tryAquireRead()
+ {
+ return tryAcquireRead();
+ }
/**
- * Attempts to aquire a write lock. This method returns immediately.
+ * Attempts to acquire a write lock. This method returns immediately.
*
* @return <code>true</code> iff the lock was successfully obtained.
*/
- public boolean tryAquireWrite()
+ public boolean tryAcquireWrite()
{
synchronized( m_lock )
{
@@ -162,5 +189,13 @@
return false;
}
}
+ }
+
+ /**
+ * @deprecated It's spelled <code>a<b>c</b>quire</code>...
+ */
+ public boolean tryAquireWrite()
+ {
+ return tryAcquireWrite();
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>