26 |
|
* <p><b>Sample usage:</b> Here is an example of using a barrier in a |
27 |
|
* parallel decomposition design: |
28 |
|
* |
29 |
< |
* <pre> {@code |
29 |
> |
* <pre> {@code |
30 |
|
* class Solver { |
31 |
|
* final int N; |
32 |
|
* final float[][] data; |
83 |
|
* {@link #await} returns the arrival index of that thread at the barrier. |
84 |
|
* You can then choose which thread should execute the barrier action, for |
85 |
|
* example: |
86 |
< |
* <pre> {@code |
86 |
> |
* <pre> {@code |
87 |
|
* if (barrier.await() == 0) { |
88 |
|
* // log the completion of this iteration |
89 |
|
* }}</pre> |