mirror of https://github.com/grpc/grpc-java.git
compiler: reduce synchronzed invocation (#2539)
not necessary to synchronze every time calling getServiceDescriptor(), if the descriptor has been created already; go with the double-checked locking idom
This commit is contained in:
parent
4693492fda
commit
3d210ae875
|
|
@ -269,16 +269,22 @@ public class BenchmarkServiceGrpc {
|
|||
}
|
||||
}
|
||||
|
||||
private static io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
if (serviceDescriptor == null) {
|
||||
serviceDescriptor = new io.grpc.ServiceDescriptor(SERVICE_NAME,
|
||||
new BenchmarkServiceDescriptorSupplier(),
|
||||
METHOD_UNARY_CALL,
|
||||
METHOD_STREAMING_CALL);
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (BenchmarkServiceGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = new io.grpc.ServiceDescriptor(
|
||||
SERVICE_NAME,
|
||||
new BenchmarkServiceDescriptorSupplier(),
|
||||
METHOD_UNARY_CALL,
|
||||
METHOD_STREAMING_CALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return serviceDescriptor;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -387,18 +387,24 @@ public class WorkerServiceGrpc {
|
|||
}
|
||||
}
|
||||
|
||||
private static io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
if (serviceDescriptor == null) {
|
||||
serviceDescriptor = new io.grpc.ServiceDescriptor(SERVICE_NAME,
|
||||
new WorkerServiceDescriptorSupplier(),
|
||||
METHOD_RUN_SERVER,
|
||||
METHOD_RUN_CLIENT,
|
||||
METHOD_CORE_COUNT,
|
||||
METHOD_QUIT_WORKER);
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (WorkerServiceGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = new io.grpc.ServiceDescriptor(
|
||||
SERVICE_NAME,
|
||||
new WorkerServiceDescriptorSupplier(),
|
||||
METHOD_RUN_SERVER,
|
||||
METHOD_RUN_CLIENT,
|
||||
METHOD_CORE_COUNT,
|
||||
METHOD_QUIT_WORKER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return serviceDescriptor;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -905,44 +905,40 @@ static void PrintGetServiceDescriptorMethod(const ServiceDescriptor* service,
|
|||
p->Print(*vars, "}\n");
|
||||
p->Outdent();
|
||||
p->Print(*vars, "}\n\n");
|
||||
|
||||
p->Print(
|
||||
*vars,
|
||||
"private static $ServiceDescriptor$ serviceDescriptor;\n\n");
|
||||
|
||||
p->Print(
|
||||
*vars,
|
||||
"public static synchronized $ServiceDescriptor$ getServiceDescriptor() {\n");
|
||||
p->Indent();
|
||||
p->Print("if (serviceDescriptor == null) {\n");
|
||||
p->Indent();
|
||||
p->Print(
|
||||
*vars,
|
||||
"serviceDescriptor = new $ServiceDescriptor$(SERVICE_NAME,\n");
|
||||
p->Indent();
|
||||
p->Indent();
|
||||
p->Print(
|
||||
*vars,
|
||||
"new $proto_descriptor_supplier$()");
|
||||
p->Outdent();
|
||||
p->Outdent();
|
||||
} else {
|
||||
p->Print(
|
||||
*vars,
|
||||
"private static $ServiceDescriptor$ serviceDescriptor;\n\n");
|
||||
p->Print(
|
||||
*vars,
|
||||
"public static synchronized $ServiceDescriptor$ getServiceDescriptor() {\n");
|
||||
p->Indent();
|
||||
p->Print("if (serviceDescriptor == null) {\n");
|
||||
p->Indent();
|
||||
p->Print(
|
||||
*vars,
|
||||
"serviceDescriptor = new $ServiceDescriptor$(SERVICE_NAME");
|
||||
}
|
||||
|
||||
p->Print(
|
||||
*vars,
|
||||
"private static volatile $ServiceDescriptor$ serviceDescriptor;\n\n");
|
||||
|
||||
p->Print(
|
||||
*vars,
|
||||
"public static $ServiceDescriptor$ getServiceDescriptor() {\n");
|
||||
p->Indent();
|
||||
p->Print(
|
||||
*vars,
|
||||
"$ServiceDescriptor$ result = serviceDescriptor;\n");
|
||||
p->Print("if (result == null) {\n");
|
||||
p->Indent();
|
||||
p->Print(
|
||||
*vars,
|
||||
"synchronized ($service_class_name$.class) {\n");
|
||||
p->Indent();
|
||||
p->Print("result = serviceDescriptor;\n");
|
||||
p->Print("if (result == null) {\n");
|
||||
p->Indent();
|
||||
|
||||
p->Print(
|
||||
*vars,
|
||||
"serviceDescriptor = result = new $ServiceDescriptor$(\n");
|
||||
p->Indent();
|
||||
p->Indent();
|
||||
p->Print("SERVICE_NAME");
|
||||
if (flavor == ProtoFlavor::NORMAL) {
|
||||
p->Print(
|
||||
*vars,
|
||||
",\nnew $proto_descriptor_supplier$()");
|
||||
}
|
||||
for (int i = 0; i < service->method_count(); ++i) {
|
||||
const MethodDescriptor* method = service->method(i);
|
||||
(*vars)["method_field_name"] = MethodPropertiesFieldName(method);
|
||||
|
|
@ -951,8 +947,14 @@ static void PrintGetServiceDescriptorMethod(const ServiceDescriptor* service,
|
|||
p->Print(");\n");
|
||||
p->Outdent();
|
||||
p->Outdent();
|
||||
|
||||
p->Outdent();
|
||||
p->Print("}\n\nreturn serviceDescriptor;\n");
|
||||
p->Print("}\n");
|
||||
p->Outdent();
|
||||
p->Print("}\n");
|
||||
p->Outdent();
|
||||
p->Print("}\n");
|
||||
p->Print("return result;\n");
|
||||
p->Outdent();
|
||||
p->Print("}\n");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -432,19 +432,25 @@ public class TestServiceGrpc {
|
|||
}
|
||||
}
|
||||
|
||||
private static io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
if (serviceDescriptor == null) {
|
||||
serviceDescriptor = new io.grpc.ServiceDescriptor(SERVICE_NAME,
|
||||
new TestServiceDescriptorSupplier(),
|
||||
METHOD_UNARY_CALL,
|
||||
METHOD_STREAMING_OUTPUT_CALL,
|
||||
METHOD_STREAMING_INPUT_CALL,
|
||||
METHOD_FULL_BIDI_CALL,
|
||||
METHOD_HALF_BIDI_CALL);
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (TestServiceGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = new io.grpc.ServiceDescriptor(
|
||||
SERVICE_NAME,
|
||||
new TestServiceDescriptorSupplier(),
|
||||
METHOD_UNARY_CALL,
|
||||
METHOD_STREAMING_OUTPUT_CALL,
|
||||
METHOD_STREAMING_INPUT_CALL,
|
||||
METHOD_FULL_BIDI_CALL,
|
||||
METHOD_HALF_BIDI_CALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return serviceDescriptor;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -425,18 +425,24 @@ public class TestServiceGrpc {
|
|||
}
|
||||
}
|
||||
|
||||
private static io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
if (serviceDescriptor == null) {
|
||||
serviceDescriptor = new io.grpc.ServiceDescriptor(SERVICE_NAME,
|
||||
METHOD_UNARY_CALL,
|
||||
METHOD_STREAMING_OUTPUT_CALL,
|
||||
METHOD_STREAMING_INPUT_CALL,
|
||||
METHOD_FULL_BIDI_CALL,
|
||||
METHOD_HALF_BIDI_CALL);
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (TestServiceGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = new io.grpc.ServiceDescriptor(
|
||||
SERVICE_NAME,
|
||||
METHOD_UNARY_CALL,
|
||||
METHOD_STREAMING_OUTPUT_CALL,
|
||||
METHOD_STREAMING_INPUT_CALL,
|
||||
METHOD_FULL_BIDI_CALL,
|
||||
METHOD_HALF_BIDI_CALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return serviceDescriptor;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -503,18 +503,24 @@ public class TestServiceGrpc {
|
|||
}
|
||||
}
|
||||
|
||||
private static io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
if (serviceDescriptor == null) {
|
||||
serviceDescriptor = new io.grpc.ServiceDescriptor(SERVICE_NAME,
|
||||
METHOD_UNARY_CALL,
|
||||
METHOD_STREAMING_OUTPUT_CALL,
|
||||
METHOD_STREAMING_INPUT_CALL,
|
||||
METHOD_FULL_BIDI_CALL,
|
||||
METHOD_HALF_BIDI_CALL);
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (TestServiceGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = new io.grpc.ServiceDescriptor(
|
||||
SERVICE_NAME,
|
||||
METHOD_UNARY_CALL,
|
||||
METHOD_STREAMING_OUTPUT_CALL,
|
||||
METHOD_STREAMING_INPUT_CALL,
|
||||
METHOD_FULL_BIDI_CALL,
|
||||
METHOD_HALF_BIDI_CALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return serviceDescriptor;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -200,15 +200,21 @@ public class LoadBalancerGrpc {
|
|||
}
|
||||
}
|
||||
|
||||
private static io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
if (serviceDescriptor == null) {
|
||||
serviceDescriptor = new io.grpc.ServiceDescriptor(SERVICE_NAME,
|
||||
new LoadBalancerDescriptorSupplier(),
|
||||
METHOD_BALANCE_LOAD);
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (LoadBalancerGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = new io.grpc.ServiceDescriptor(
|
||||
SERVICE_NAME,
|
||||
new LoadBalancerDescriptorSupplier(),
|
||||
METHOD_BALANCE_LOAD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return serviceDescriptor;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,15 +210,21 @@ public class HealthGrpc {
|
|||
}
|
||||
}
|
||||
|
||||
private static io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
if (serviceDescriptor == null) {
|
||||
serviceDescriptor = new io.grpc.ServiceDescriptor(SERVICE_NAME,
|
||||
new HealthDescriptorSupplier(),
|
||||
METHOD_CHECK);
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (HealthGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = new io.grpc.ServiceDescriptor(
|
||||
SERVICE_NAME,
|
||||
new HealthDescriptorSupplier(),
|
||||
METHOD_CHECK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return serviceDescriptor;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -202,15 +202,21 @@ public class ServerReflectionGrpc {
|
|||
}
|
||||
}
|
||||
|
||||
private static io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
if (serviceDescriptor == null) {
|
||||
serviceDescriptor = new io.grpc.ServiceDescriptor(SERVICE_NAME,
|
||||
new ServerReflectionDescriptorSupplier(),
|
||||
METHOD_SERVER_REFLECTION_INFO);
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (ServerReflectionGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = new io.grpc.ServiceDescriptor(
|
||||
SERVICE_NAME,
|
||||
new ServerReflectionDescriptorSupplier(),
|
||||
METHOD_SERVER_REFLECTION_INFO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return serviceDescriptor;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,15 +210,21 @@ public class DynamicServiceGrpc {
|
|||
}
|
||||
}
|
||||
|
||||
private static io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
if (serviceDescriptor == null) {
|
||||
serviceDescriptor = new io.grpc.ServiceDescriptor(SERVICE_NAME,
|
||||
new DynamicServiceDescriptorSupplier(),
|
||||
METHOD_METHOD);
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (DynamicServiceGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = new io.grpc.ServiceDescriptor(
|
||||
SERVICE_NAME,
|
||||
new DynamicServiceDescriptorSupplier(),
|
||||
METHOD_METHOD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return serviceDescriptor;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -210,15 +210,21 @@ public class ReflectableServiceGrpc {
|
|||
}
|
||||
}
|
||||
|
||||
private static io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
if (serviceDescriptor == null) {
|
||||
serviceDescriptor = new io.grpc.ServiceDescriptor(SERVICE_NAME,
|
||||
new ReflectableServiceDescriptorSupplier(),
|
||||
METHOD_METHOD);
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (ReflectableServiceGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = new io.grpc.ServiceDescriptor(
|
||||
SERVICE_NAME,
|
||||
new ReflectableServiceDescriptorSupplier(),
|
||||
METHOD_METHOD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return serviceDescriptor;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -278,16 +278,22 @@ public class MetricsServiceGrpc {
|
|||
}
|
||||
}
|
||||
|
||||
private static io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
if (serviceDescriptor == null) {
|
||||
serviceDescriptor = new io.grpc.ServiceDescriptor(SERVICE_NAME,
|
||||
new MetricsServiceDescriptorSupplier(),
|
||||
METHOD_GET_ALL_GAUGES,
|
||||
METHOD_GET_GAUGE);
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (MetricsServiceGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = new io.grpc.ServiceDescriptor(
|
||||
SERVICE_NAME,
|
||||
new MetricsServiceDescriptorSupplier(),
|
||||
METHOD_GET_ALL_GAUGES,
|
||||
METHOD_GET_GAUGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return serviceDescriptor;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -276,16 +276,22 @@ public class ReconnectServiceGrpc {
|
|||
}
|
||||
}
|
||||
|
||||
private static io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
if (serviceDescriptor == null) {
|
||||
serviceDescriptor = new io.grpc.ServiceDescriptor(SERVICE_NAME,
|
||||
new ReconnectServiceDescriptorSupplier(),
|
||||
METHOD_START,
|
||||
METHOD_STOP);
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (ReconnectServiceGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = new io.grpc.ServiceDescriptor(
|
||||
SERVICE_NAME,
|
||||
new ReconnectServiceDescriptorSupplier(),
|
||||
METHOD_START,
|
||||
METHOD_STOP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return serviceDescriptor;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -563,21 +563,27 @@ public class TestServiceGrpc {
|
|||
}
|
||||
}
|
||||
|
||||
private static io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
if (serviceDescriptor == null) {
|
||||
serviceDescriptor = new io.grpc.ServiceDescriptor(SERVICE_NAME,
|
||||
new TestServiceDescriptorSupplier(),
|
||||
METHOD_EMPTY_CALL,
|
||||
METHOD_UNARY_CALL,
|
||||
METHOD_STREAMING_OUTPUT_CALL,
|
||||
METHOD_STREAMING_INPUT_CALL,
|
||||
METHOD_FULL_DUPLEX_CALL,
|
||||
METHOD_HALF_DUPLEX_CALL,
|
||||
METHOD_UNIMPLEMENTED_CALL);
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (TestServiceGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = new io.grpc.ServiceDescriptor(
|
||||
SERVICE_NAME,
|
||||
new TestServiceDescriptorSupplier(),
|
||||
METHOD_EMPTY_CALL,
|
||||
METHOD_UNARY_CALL,
|
||||
METHOD_STREAMING_OUTPUT_CALL,
|
||||
METHOD_STREAMING_INPUT_CALL,
|
||||
METHOD_FULL_DUPLEX_CALL,
|
||||
METHOD_HALF_DUPLEX_CALL,
|
||||
METHOD_UNIMPLEMENTED_CALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return serviceDescriptor;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -242,15 +242,21 @@ public class UnimplementedServiceGrpc {
|
|||
}
|
||||
}
|
||||
|
||||
private static io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
private static volatile io.grpc.ServiceDescriptor serviceDescriptor;
|
||||
|
||||
public static synchronized io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
if (serviceDescriptor == null) {
|
||||
serviceDescriptor = new io.grpc.ServiceDescriptor(SERVICE_NAME,
|
||||
new UnimplementedServiceDescriptorSupplier(),
|
||||
METHOD_UNIMPLEMENTED_CALL);
|
||||
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
|
||||
io.grpc.ServiceDescriptor result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
synchronized (UnimplementedServiceGrpc.class) {
|
||||
result = serviceDescriptor;
|
||||
if (result == null) {
|
||||
serviceDescriptor = result = new io.grpc.ServiceDescriptor(
|
||||
SERVICE_NAME,
|
||||
new UnimplementedServiceDescriptorSupplier(),
|
||||
METHOD_UNIMPLEMENTED_CALL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return serviceDescriptor;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue