aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/surface/completion_queue.h
diff options
context:
space:
mode:
authorGravatar vjpai <vpai@google.com>2015-07-10 19:48:17 -0700
committerGravatar vjpai <vpai@google.com>2015-07-10 19:48:17 -0700
commita8822999840a7c550692b372ff93841fa43907bd (patch)
tree0feda344bff960f3331f9f222a4cd0316e5e4099 /src/core/surface/completion_queue.h
parent10a6546cb94373b7d57f3cb2d567edfbb0742d7c (diff)
parent4547d503d37ade45866688dae3ce291ec8a450bd (diff)
Merge branch 'master' into lockfree-stack
Diffstat (limited to 'src/core/surface/completion_queue.h')
-rw-r--r--src/core/surface/completion_queue.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/core/surface/completion_queue.h b/src/core/surface/completion_queue.h
index 1b9010f462..f944f48d8e 100644
--- a/src/core/surface/completion_queue.h
+++ b/src/core/surface/completion_queue.h
@@ -39,6 +39,17 @@
#include "src/core/iomgr/pollset.h"
#include <grpc/grpc.h>
+typedef struct grpc_cq_completion {
+ /** user supplied tag */
+ void *tag;
+ /** done callback - called when this queue element is no longer
+ needed by the completion queue */
+ void (*done)(void *done_arg, struct grpc_cq_completion *c);
+ void *done_arg;
+ /** next pointer; low bit is used to indicate success or not */
+ gpr_uintptr next;
+} grpc_cq_completion;
+
#ifdef GRPC_CQ_REF_COUNT_DEBUG
void grpc_cq_internal_ref(grpc_completion_queue *cc, const char *reason,
const char *file, int line);
@@ -57,11 +68,12 @@ void grpc_cq_internal_unref(grpc_completion_queue *cc);
/* Flag that an operation is beginning: the completion channel will not finish
shutdown until a corrensponding grpc_cq_end_* call is made */
-void grpc_cq_begin_op(grpc_completion_queue *cc, grpc_call *call);
+void grpc_cq_begin_op(grpc_completion_queue *cc);
/* Queue a GRPC_OP_COMPLETED operation */
-void grpc_cq_end_op(grpc_completion_queue *cc, void *tag, grpc_call *call,
- int success);
+void grpc_cq_end_op(grpc_completion_queue *cc, void *tag, int success,
+ void (*done)(void *done_arg, grpc_cq_completion *storage),
+ void *done_arg, grpc_cq_completion *storage);
grpc_pollset *grpc_cq_pollset(grpc_completion_queue *cc);