diff options
author | 2016-05-09 15:18:11 -0700 | |
---|---|---|
committer | 2016-05-09 15:42:32 -0700 | |
commit | 1e1fa0870f60b1c0d23da17b2aa7db9a3ca7f1ae (patch) | |
tree | d2574f7e7a717d2b495a41deaf4b15eedb8ba8b9 /src/csharp/Grpc.Core | |
parent | df0872f2a609c9fc448923ad6a466f9b9033a63a (diff) |
dont lock to run server_request_call
Diffstat (limited to 'src/csharp/Grpc.Core')
-rw-r--r-- | src/csharp/Grpc.Core/Server.cs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/csharp/Grpc.Core/Server.cs b/src/csharp/Grpc.Core/Server.cs index fea76d557a..3a337ba831 100644 --- a/src/csharp/Grpc.Core/Server.cs +++ b/src/csharp/Grpc.Core/Server.cs @@ -66,7 +66,7 @@ namespace Grpc.Core readonly TaskCompletionSource<object> shutdownTcs = new TaskCompletionSource<object>(); bool startRequested; - bool shutdownRequested; + volatile bool shutdownRequested; /// <summary> /// Create a new server. @@ -246,12 +246,9 @@ namespace Grpc.Core /// </summary> private void AllowOneRpc() { - lock (myLock) + if (!shutdownRequested) { - if (!shutdownRequested) - { - handle.RequestCall(HandleNewServerRpc, environment); - } + handle.RequestCall(HandleNewServerRpc, environment); } } |