57 |
|
* public void run() { |
58 |
|
* try { |
59 |
|
* while(true) { queue.put(produce()); } |
60 |
< |
* } |
61 |
< |
* catch (InterruptedException ex) { ... handle ...} |
60 |
> |
* } catch (InterruptedException ex) { ... handle ...} |
61 |
|
* } |
62 |
|
* Object produce() { ... } |
63 |
|
* } |
68 |
|
* public void run() { |
69 |
|
* try { |
70 |
|
* while(true) { consume(queue.take()); } |
71 |
< |
* } |
73 |
< |
* catch (InterruptedException ex) { ... handle ...} |
71 |
> |
* } catch (InterruptedException ex) { ... handle ...} |
72 |
|
* } |
73 |
|
* void consume(Object x) { ... } |
74 |
|
* } |