Skip to content

Commit aebb58b

Browse files
Change awaitTerminated to awaitTermination
1 parent a947178 commit aebb58b

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

benchmarks/src/jmh/java/io/grpc/benchmarks/TransportBenchmark.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ public void setUp() throws Exception {
147147
public void tearDown() throws Exception {
148148
channel.shutdown();
149149
server.shutdown();
150-
channel.awaitTerminated(1, TimeUnit.SECONDS);
151-
server.awaitTerminated(1, TimeUnit.SECONDS);
150+
channel.awaitTermination(1, TimeUnit.SECONDS);
151+
server.awaitTermination(1, TimeUnit.SECONDS);
152152
if (!channel.isTerminated()) {
153153
throw new Exception("failed to shut down channel");
154154
}

benchmarks/src/jmh/java/io/grpc/benchmarks/netty/AbstractBenchmark.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ protected void teardown() throws Exception {
488488
for (ChannelImpl channel : channels) {
489489
channel.shutdown();
490490
}
491-
server.shutdown().awaitTerminated(5, TimeUnit.SECONDS);
491+
server.shutdown().awaitTermination(5, TimeUnit.SECONDS);
492492
}
493493

494494
/**

benchmarks/src/main/java/io/grpc/benchmarks/qps/AsyncServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public void run() {
9292
try {
9393
System.out.println("QPS Server shutting down");
9494
server.shutdown();
95-
server.awaitTerminated(5, TimeUnit.SECONDS);
95+
server.awaitTermination(5, TimeUnit.SECONDS);
9696
} catch (Exception e) {
9797
e.printStackTrace();
9898
}

core/src/main/java/io/grpc/ChannelImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public boolean isShutdown() {
184184
*
185185
* @return whether the channel is terminated, as would be done by {@link #isTerminated()}.
186186
*/
187-
public boolean awaitTerminated(long timeout, TimeUnit unit) throws InterruptedException {
187+
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
188188
synchronized (lock) {
189189
long timeoutNanos = unit.toNanos(timeout);
190190
long endTimeNanos = System.nanoTime() + timeoutNanos;

core/src/main/java/io/grpc/ServerImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public boolean isShutdown() {
182182
*
183183
* @return whether the server is terminated, as would be done by {@link #isTerminated()}.
184184
*/
185-
public boolean awaitTerminated(long timeout, TimeUnit unit) throws InterruptedException {
185+
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException {
186186
synchronized (lock) {
187187
long timeoutNanos = unit.toNanos(timeout);
188188
long endTimeNanos = System.nanoTime() + timeoutNanos;
@@ -196,7 +196,7 @@ public boolean awaitTerminated(long timeout, TimeUnit unit) throws InterruptedEx
196196
/**
197197
* Waits for the server to become terminated.
198198
*/
199-
public void awaitTerminated() throws InterruptedException {
199+
public void awaitTermination() throws InterruptedException {
200200
synchronized (lock) {
201201
while (!terminated) {
202202
lock.wait();

examples/src/main/java/io/grpc/examples/header/CustomHeaderClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ private CustomHeaderClient(String host, int port) {
6868
}
6969

7070
private void shutdown() throws InterruptedException {
71-
originChannel.shutdown().awaitTerminated(5, TimeUnit.SECONDS);
71+
originChannel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
7272
}
7373

7474
/**

examples/src/main/java/io/grpc/examples/helloworld/HelloWorldClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public HelloWorldClient(String host, int port) {
5757
}
5858

5959
public void shutdown() throws InterruptedException {
60-
channel.shutdown().awaitTerminated(5, TimeUnit.SECONDS);
60+
channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
6161
}
6262

6363
/** Say hello to server. */

examples/src/main/java/io/grpc/examples/routeguide/RouteGuideClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public RouteGuideClient(String host, int port) {
6767
}
6868

6969
public void shutdown() throws InterruptedException {
70-
channel.shutdown().awaitTerminated(5, TimeUnit.SECONDS);
70+
channel.shutdown().awaitTermination(5, TimeUnit.SECONDS);
7171
}
7272

7373
/**

interop-testing/src/main/java/io/grpc/testing/integration/TestServiceServer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ private void start() throws Exception {
147147

148148
private void stop() throws Exception {
149149
server.shutdownNow();
150-
if (!server.awaitTerminated(5, TimeUnit.SECONDS)) {
150+
if (!server.awaitTermination(5, TimeUnit.SECONDS)) {
151151
System.err.println("Timed out waiting for server shutdown");
152152
}
153153
MoreExecutors.shutdownAndAwaitTermination(executor, 5, TimeUnit.SECONDS);

netty/src/main/java/io/grpc/transport/netty/NettyServerBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public NettyServerBuilder channelType(Class<? extends ServerChannel> channelType
127127
* For example, Netty's {@link EventLoopGroup}s use daemon threads by default
128128
* and thus an application with only daemon threads running besides the main thread will exit as
129129
* soon as the main thread completes.
130-
* A simple solution to this problem is to call {@link io.grpc.ServerImpl#awaitTerminated()} to
130+
* A simple solution to this problem is to call {@link io.grpc.ServerImpl#awaitTermination()} to
131131
* keep the main thread alive until the server has terminated.
132132
*/
133133
public NettyServerBuilder bossEventLoopGroup(EventLoopGroup group) {
@@ -150,7 +150,7 @@ public NettyServerBuilder bossEventLoopGroup(EventLoopGroup group) {
150150
* For example, Netty's {@link EventLoopGroup}s use daemon threads by default
151151
* and thus an application with only daemon threads running besides the main thread will exit as
152152
* soon as the main thread completes.
153-
* A simple solution to this problem is to call {@link io.grpc.ServerImpl#awaitTerminated()} to
153+
* A simple solution to this problem is to call {@link io.grpc.ServerImpl#awaitTermination()} to
154154
* keep the main thread alive until the server has terminated.
155155
*/
156156
public NettyServerBuilder workerEventLoopGroup(EventLoopGroup group) {

0 commit comments

Comments
 (0)