218 |
|
t.join(); |
219 |
|
} |
220 |
|
|
221 |
– |
|
222 |
– |
/** |
223 |
– |
* take blocks interruptibly when empty |
224 |
– |
*/ |
225 |
– |
public void testTakeFromEmpty() throws InterruptedException { |
226 |
– |
final SynchronousQueue q = new SynchronousQueue(); |
227 |
– |
Thread t = new Thread(new CheckedInterruptedRunnable() { |
228 |
– |
public void realRun() throws InterruptedException { |
229 |
– |
q.take(); |
230 |
– |
}}); |
231 |
– |
|
232 |
– |
t.start(); |
233 |
– |
Thread.sleep(SHORT_DELAY_MS); |
234 |
– |
t.interrupt(); |
235 |
– |
t.join(); |
236 |
– |
} |
237 |
– |
|
238 |
– |
|
221 |
|
/** |
222 |
|
* put blocks interruptibly if no active taker |
223 |
|
*/ |