< prev index next >

src/java.base/share/classes/java/util/concurrent/locks/ReentrantReadWriteLock.java

Print this page
8234131: Miscellaneous changes imported from jsr166 CVS 2021-01
Reviewed-by: martin

@@ -126,11 +126,11 @@
  *
  * <p>Serialization of this class behaves in the same way as built-in
  * locks: a deserialized lock is in the unlocked state, regardless of
  * its state when serialized.
  *
- * <p><b>Sample usages</b>. Here is a code sketch showing how to perform
+ * <p><b>Sample usages.</b> Here is a code sketch showing how to perform
  * lock downgrading after updating a cache (exception handling is
  * particularly tricky when handling multiple locks in a non-nested
  * fashion):
  *
  * <pre> {@code

@@ -147,11 +147,11 @@
  *       rwl.writeLock().lock();
  *       try {
  *         // Recheck state because another thread might have
  *         // acquired write lock and changed state before we did.
  *         if (!cacheValid) {
- *           data = ...
+ *           data = ...;
  *           cacheValid = true;
  *         }
  *         // Downgrade by acquiring read lock before releasing write lock
  *         rwl.readLock().lock();
  *       } finally {
< prev index next >