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 |
|
*/ |
303 |
|
} |
304 |
|
|
305 |
|
/** |
306 |
< |
* timed pool with zero timeout times out if no active taker |
306 |
> |
* timed poll with zero timeout times out if no active taker |
307 |
|
*/ |
308 |
|
public void testTimedPoll0() throws InterruptedException { |
309 |
|
SynchronousQueue q = new SynchronousQueue(); |
311 |
|
} |
312 |
|
|
313 |
|
/** |
314 |
< |
* timed pool with nonzero timeout times out if no active taker |
314 |
> |
* timed poll with nonzero timeout times out if no active taker |
315 |
|
*/ |
316 |
|
public void testTimedPoll() throws InterruptedException { |
317 |
|
SynchronousQueue q = new SynchronousQueue(); |
353 |
|
} |
354 |
|
|
355 |
|
/** |
356 |
< |
* timed poll before a delayed offer fails; after offer succeeds; |
357 |
< |
* on interruption throws |
356 |
> |
* timed poll before a delayed offer fails; after offer succeeds; |
357 |
> |
* on interruption throws |
358 |
|
*/ |
359 |
|
public void testFairTimedPollWithOffer() throws InterruptedException { |
360 |
|
final SynchronousQueue q = new SynchronousQueue(true); |