98 |
|
* Usage example, based on a typical producer-consumer scenario. |
99 |
|
* Note that a <tt>BlockingQueue</tt> can safely be used with multiple |
100 |
|
* producers and multiple consumers. |
101 |
< |
* <pre> |
101 |
> |
* <pre> {@code |
102 |
|
* class Producer implements Runnable { |
103 |
|
* private final BlockingQueue queue; |
104 |
|
* Producer(BlockingQueue q) { queue = q; } |
131 |
|
* new Thread(c1).start(); |
132 |
|
* new Thread(c2).start(); |
133 |
|
* } |
134 |
< |
* } |
135 |
< |
* </pre> |
134 |
> |
* }}</pre> |
135 |
|
* |
136 |
|
* <p>Memory consistency effects: As with other concurrent |
137 |
|
* collections, actions in a thread prior to placing an object into a |