diff options
author | Jan Tattermusch <jtattermusch@google.com> | 2017-08-08 10:58:15 +0200 |
---|---|---|
committer | Jan Tattermusch <jtattermusch@google.com> | 2017-08-08 10:58:15 +0200 |
commit | ae607078fcd00d7b11eacca4ea1937b428547304 (patch) | |
tree | 7b931ed87fdb64aed24baa1cd3e81717fd10969e /src/csharp/Grpc.Core | |
parent | 4ea8ce19ea2c6d2f9629e06955b0ce62e82266da (diff) |
address comments
Diffstat (limited to 'src/csharp/Grpc.Core')
-rw-r--r-- | src/csharp/Grpc.Core/GrpcEnvironment.cs | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/csharp/Grpc.Core/GrpcEnvironment.cs b/src/csharp/Grpc.Core/GrpcEnvironment.cs index a466c9fa37..9fad5c6a54 100644 --- a/src/csharp/Grpc.Core/GrpcEnvironment.cs +++ b/src/csharp/Grpc.Core/GrpcEnvironment.cs @@ -43,8 +43,6 @@ namespace Grpc.Core static readonly HashSet<Channel> registeredChannels = new HashSet<Channel>(); static readonly HashSet<Server> registeredServers = new HashSet<Server>(); - static EventHandler shuttingDown; - static ILogger logger = new NullLogger(); readonly GrpcThreadPool threadPool; @@ -242,17 +240,7 @@ namespace Grpc.Core /// <summary> /// Occurs when <c>GrpcEnvironment</c> is about the start the shutdown logic. /// </summary> - public static event EventHandler ShuttingDown - { - add - { - shuttingDown += value; - } - remove - { - shuttingDown -= value; - } - } + public static event EventHandler ShuttingDown; /// <summary> /// Creates gRPC environment. @@ -333,7 +321,7 @@ namespace Grpc.Core throw new InvalidOperationException("ShutdownAsync has already been called"); } - await Task.Run(() => shuttingDown.Invoke(this, null)); + await Task.Run(() => ShuttingDown?.Invoke(this, null)); await threadPool.StopAsync().ConfigureAwait(false); GrpcNativeShutdown(); |