diff options
author | 2016-06-01 14:08:26 -0700 | |
---|---|---|
committer | 2016-06-06 15:04:05 -0700 | |
commit | 739ee1b159cd0925cbc448c4b95728926f1a0e60 (patch) | |
tree | 49fa5c4485e4fabac8928c2c51191f3bed232ed4 /src/csharp/Grpc.Core/Internal | |
parent | 63386a1064f9b27b0590c1e10f7176a45b0a3f36 (diff) |
support GrpcEnvironment.KillServersAsync
Diffstat (limited to 'src/csharp/Grpc.Core/Internal')
-rw-r--r-- | src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs b/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs index 8643abf536..a446c1f99f 100644 --- a/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs +++ b/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs @@ -114,6 +114,21 @@ namespace Grpc.Core.Internal }); } + /// <summary> + /// Returns true if there is at least one thread pool thread that hasn't + /// already stopped. + /// Threads can either stop because all completion queues shut down or + /// because all foreground threads have already shutdown and process is + /// going to exit. + /// </summary> + internal bool IsAlive + { + get + { + return threads.Any(t => t.ThreadState != ThreadState.Stopped); + } + } + internal IReadOnlyCollection<CompletionQueueSafeHandle> CompletionQueues { get |