forbid BeginOp and EndOp for sync completion queue altogether

pull/19629/head
Jan Tattermusch 5 years ago
parent 7142d9e2dc
commit bc1283c43b
  1. 16
      src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs

@ -104,20 +104,16 @@ namespace Grpc.Core.Internal
private void BeginOp()
{
if (shutdownRefcount != null)
{
bool success = false;
shutdownRefcount.IncrementIfNonzero(ref success);
GrpcPreconditions.CheckState(success, "Shutdown has already been called");
}
GrpcPreconditions.CheckNotNull(shutdownRefcount, nameof(shutdownRefcount));
bool success = false;
shutdownRefcount.IncrementIfNonzero(ref success);
GrpcPreconditions.CheckState(success, "Shutdown has already been called");
}
private void EndOp()
{
if (shutdownRefcount != null)
{
DecrementShutdownRefcount();
}
GrpcPreconditions.CheckNotNull(shutdownRefcount, nameof(shutdownRefcount));
DecrementShutdownRefcount();
}
// Allows declaring BeginOp and EndOp of a completion queue with a using statement.

Loading…
Cancel
Save