blob: 6e1ddb07b464419ea5ef3b9d3a79dc3d9873f75b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.jdisc.handler;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
/**
* @author Simon Thoresen Hult
*/
class RunnableLatch implements Runnable {
private final CountDownLatch latch = new CountDownLatch(1);
@Override
public void run() {
latch.countDown();
}
public boolean await(long timeout, TimeUnit unit) throws InterruptedException {
return latch.await(timeout, unit);
}
}
|