aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs
diff options
context:
space:
mode:
authorGravatar David Garcia Quintas <dgq@google.com>2016-06-03 14:18:01 -0700
committerGravatar David Garcia Quintas <dgq@google.com>2016-06-03 14:18:01 -0700
commit55c08f81cff3d8231d4ae18b2a8f9e4abccc2d76 (patch)
tree0ad9cdab1db83fe008829bdcfedf2525ab94d860 /src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs
parent3e4f49f88d611efb9573972a18ca727f50292d14 (diff)
parent84f71932eaf8b601355189896fc5b91449ac82d2 (diff)
Merge branch 'master' of github.com:grpc/grpc into compression_md_level_bis
Diffstat (limited to 'src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs')
-rw-r--r--src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs b/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs
index 91364cdc70..46f5624223 100644
--- a/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs
+++ b/src/csharp/Grpc.Core/Internal/CompletionQueueSafeHandle.cs
@@ -45,6 +45,7 @@ namespace Grpc.Core.Internal
static readonly NativeMethods Native = NativeMethods.Get();
AtomicCounter shutdownRefcount = new AtomicCounter(1);
+ CompletionRegistry completionRegistry;
private CompletionQueueSafeHandle()
{
@@ -53,7 +54,13 @@ namespace Grpc.Core.Internal
public static CompletionQueueSafeHandle Create()
{
return Native.grpcsharp_completion_queue_create();
+ }
+ public static CompletionQueueSafeHandle Create(CompletionRegistry completionRegistry)
+ {
+ var cq = Native.grpcsharp_completion_queue_create();
+ cq.completionRegistry = completionRegistry;
+ return cq;
}
public CompletionQueueEvent Next()
@@ -83,6 +90,15 @@ namespace Grpc.Core.Internal
DecrementShutdownRefcount();
}
+ /// <summary>
+ /// Completion registry associated with this completion queue.
+ /// Doesn't need to be set if only using Pluck() operations.
+ /// </summary>
+ public CompletionRegistry CompletionRegistry
+ {
+ get { return completionRegistry; }
+ }
+
protected override bool ReleaseHandle()
{
Native.grpcsharp_completion_queue_destroy(handle);