< prev index next >
src/java.corba/share/classes/com/sun/corba/se/impl/orbutil/concurrent/Sync.java
Print this page
@@ -179,15 +179,15 @@
* }
* catch (InterruptedException ex) { return; }
* }
* }
* }
- *</pre>
+ * </pre>
* <p>
* Here is an even fancier version, that uses lock re-ordering
* upon conflict:
- * <pre>
+ * <pre>{@code
* class Cell {
* long value;
* Sync lock = ...;
* private static boolean trySwap(Cell a, Cell b) {
* a.lock.acquire();
@@ -212,12 +212,12 @@
* !tryswap(other, this))
* Thread.sleep(1);
* }
* catch (InterruptedException ex) { return; }
* }
- *}
- *</pre>
+ * }
+ * }</pre>
* <p>
* Interruptions are in general handled as early as possible.
* Normally, InterruptionExceptions are thrown
* in acquire and attempt(msec) if interruption
* is detected upon entry to the method, as well as in any
@@ -246,11 +246,11 @@
* <p>
* Syncs may also be used in spinlock constructions. Although
* it is normally best to just use acquire(), various forms
* of busy waits can be implemented. For a simple example
* (but one that would probably never be preferable to using acquire()):
- * <pre>
+ * <pre>{@code
* class X {
* Sync lock = ...
* void spinUntilAcquired() throws InterruptedException {
* // Two phase.
* // First spin without pausing.
@@ -267,19 +267,19 @@
* else
* waitTime = waitTime * 3 / 2 + 1; // increase 50%
* }
* }
* }
- * </pre>
+ * }</pre>
* <p>
* In addition pure synchronization control, Syncs
* may be useful in any context requiring before/after methods.
* For example, you can use an ObservableSync
* (perhaps as part of a LayeredSync) in order to obtain callbacks
* before and after each method invocation for a given class.
*
- * <p>[<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
+ * [<a href="http://gee.cs.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html"> Introduction to this package. </a>]
**/
public interface Sync {
< prev index next >