ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/Exchanger.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/Exchanger.java (file contents):
Revision 1.49 by jsr166, Sun Apr 24 17:54:20 2011 UTC vs.
Revision 1.50 by jsr166, Thu Jun 9 07:48:43 2011 UTC

# Line 23 | Line 23 | import java.util.concurrent.locks.LockSu
23   * to swap buffers between threads so that the thread filling the
24   * buffer gets a freshly emptied one when it needs it, handing off the
25   * filled one to the thread emptying the buffer.
26 < * <pre>{@code
26 > *  <pre> {@code
27   * class FillAndEmpty {
28   *   Exchanger<DataBuffer> exchanger = new Exchanger<DataBuffer>();
29   *   DataBuffer initialEmptyBuffer = ... a made-up type
# Line 59 | Line 59 | import java.util.concurrent.locks.LockSu
59   *     new Thread(new FillingLoop()).start();
60   *     new Thread(new EmptyingLoop()).start();
61   *   }
62 < * }
63 < * }</pre>
62 > * }}</pre>
63   *
64   * <p>Memory consistency effects: For each pair of threads that
65   * successfully exchange objects via an {@code Exchanger}, actions

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines