diff options
Diffstat (limited to 'src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs')
-rw-r--r-- | src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs b/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs index 9e69fe2f43..f4224668f1 100644 --- a/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs +++ b/src/csharp/Grpc.Core/Internal/GrpcThreadPool.cs @@ -51,12 +51,13 @@ namespace Grpc.Core.Internal CompletionQueueSafeHandle cq; - public GrpcThreadPool(int poolSize) { + public GrpcThreadPool(int poolSize) + { this.poolSize = poolSize; } - public void Start() { - + public void Start() + { lock (myLock) { if (cq != null) @@ -73,8 +74,8 @@ namespace Grpc.Core.Internal } } - public void Stop() { - + public void Stop() + { lock (myLock) { cq.Shutdown(); @@ -86,7 +87,6 @@ namespace Grpc.Core.Internal } cq.Dispose(); - } } @@ -116,10 +116,9 @@ namespace Grpc.Core.Internal do { completionType = cq.NextWithCallback(); - } while(completionType != GRPCCompletionType.GRPC_QUEUE_SHUTDOWN); + } + while (completionType != GRPCCompletionType.GRPC_QUEUE_SHUTDOWN); Console.WriteLine("Completion queue has shutdown successfully, thread " + Thread.CurrentThread.Name + " exiting."); } } - } - |