Enters this monitor when the guard is satisfied. Blocks indefinitely.
(Guard guard)
| 476 | |
| 477 | |
| 478 | public void enterWhenUninterruptibly(Guard guard) { |
| 479 | if (guard.monitor != this) { |
| 480 | throw new IllegalMonitorStateException(); |
| 481 | } |
| 482 | final ReentrantLock lock = this.lock; |
| 483 | boolean signalBeforeWaiting = lock.isHeldByCurrentThread(); |
| 484 | lock.lock(); |
| 485 | boolean satisfied = false; |
| 486 | try { |
| 487 | if (!guard.isSatisfied()) { |
| 488 | awaitUninterruptibly(guard, signalBeforeWaiting); |
| 489 | } |
| 490 | satisfied = true; |
| 491 | } finally { |
| 492 | if (!satisfied) { |
| 493 | leave(); |
| 494 | } |
| 495 | } |
| 496 | } |
| 497 | |
| 498 | /** |
| 499 | * Enters this monitor when the guard is satisfied. Blocks at most the given time, including both |
no test coverage detected