aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/surface/alarm.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lib/surface/alarm.cc')
-rw-r--r--src/core/lib/surface/alarm.cc40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/core/lib/surface/alarm.cc b/src/core/lib/surface/alarm.cc
index 16a16bfd93..bc38692ec8 100644
--- a/src/core/lib/surface/alarm.cc
+++ b/src/core/lib/surface/alarm.cc
@@ -38,14 +38,14 @@ struct grpc_alarm {
grpc_closure on_alarm;
grpc_cq_completion completion;
/** completion queue where events about this alarm will be posted */
- grpc_completion_queue *cq;
+ grpc_completion_queue* cq;
/** user supplied tag */
- void *tag;
+ void* tag;
};
-static void alarm_ref(grpc_alarm *alarm) { gpr_ref(&alarm->refs); }
+static void alarm_ref(grpc_alarm* alarm) { gpr_ref(&alarm->refs); }
-static void alarm_unref(grpc_alarm *alarm) {
+static void alarm_unref(grpc_alarm* alarm) {
if (gpr_unref(&alarm->refs)) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
if (alarm->cq != NULL) {
@@ -57,8 +57,8 @@ static void alarm_unref(grpc_alarm *alarm) {
}
#ifndef NDEBUG
-static void alarm_ref_dbg(grpc_alarm *alarm, const char *reason,
- const char *file, int line) {
+static void alarm_ref_dbg(grpc_alarm* alarm, const char* reason,
+ const char* file, int line) {
if (GRPC_TRACER_ON(grpc_trace_alarm_refcount)) {
gpr_atm val = gpr_atm_no_barrier_load(&alarm->refs.count);
gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
@@ -69,8 +69,8 @@ static void alarm_ref_dbg(grpc_alarm *alarm, const char *reason,
alarm_ref(alarm);
}
-static void alarm_unref_dbg(grpc_alarm *alarm, const char *reason,
- const char *file, int line) {
+static void alarm_unref_dbg(grpc_alarm* alarm, const char* reason,
+ const char* file, int line) {
if (GRPC_TRACER_ON(grpc_trace_alarm_refcount)) {
gpr_atm val = gpr_atm_no_barrier_load(&alarm->refs.count);
gpr_log(file, line, GPR_LOG_SEVERITY_DEBUG,
@@ -82,25 +82,25 @@ static void alarm_unref_dbg(grpc_alarm *alarm, const char *reason,
}
#endif
-static void alarm_end_completion(grpc_exec_ctx *exec_ctx, void *arg,
- grpc_cq_completion *c) {
- grpc_alarm *alarm = (grpc_alarm *)arg;
+static void alarm_end_completion(grpc_exec_ctx* exec_ctx, void* arg,
+ grpc_cq_completion* c) {
+ grpc_alarm* alarm = (grpc_alarm*)arg;
GRPC_ALARM_UNREF(alarm, "dequeue-end-op");
}
-static void alarm_cb(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) {
- grpc_alarm *alarm = (grpc_alarm *)arg;
+static void alarm_cb(grpc_exec_ctx* exec_ctx, void* arg, grpc_error* error) {
+ grpc_alarm* alarm = (grpc_alarm*)arg;
/* We are queuing an op on completion queue. This means, the alarm's structure
cannot be destroyed until the op is dequeued. Adding an extra ref
here and unref'ing when the op is dequeued will achieve this */
GRPC_ALARM_REF(alarm, "queue-end-op");
grpc_cq_end_op(exec_ctx, alarm->cq, alarm->tag, error, alarm_end_completion,
- (void *)alarm, &alarm->completion);
+ (void*)alarm, &alarm->completion);
}
-grpc_alarm *grpc_alarm_create(void *reserved) {
- grpc_alarm *alarm = (grpc_alarm *)gpr_malloc(sizeof(grpc_alarm));
+grpc_alarm* grpc_alarm_create(void* reserved) {
+ grpc_alarm* alarm = (grpc_alarm*)gpr_malloc(sizeof(grpc_alarm));
#ifndef NDEBUG
if (GRPC_TRACER_ON(grpc_trace_alarm_refcount)) {
@@ -116,8 +116,8 @@ grpc_alarm *grpc_alarm_create(void *reserved) {
return alarm;
}
-void grpc_alarm_set(grpc_alarm *alarm, grpc_completion_queue *cq,
- gpr_timespec deadline, void *tag, void *reserved) {
+void grpc_alarm_set(grpc_alarm* alarm, grpc_completion_queue* cq,
+ gpr_timespec deadline, void* tag, void* reserved) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
GRPC_CQ_INTERNAL_REF(cq, "alarm");
@@ -130,13 +130,13 @@ void grpc_alarm_set(grpc_alarm *alarm, grpc_completion_queue *cq,
grpc_exec_ctx_finish(&exec_ctx);
}
-void grpc_alarm_cancel(grpc_alarm *alarm, void *reserved) {
+void grpc_alarm_cancel(grpc_alarm* alarm, void* reserved) {
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
grpc_timer_cancel(&exec_ctx, &alarm->alarm);
grpc_exec_ctx_finish(&exec_ctx);
}
-void grpc_alarm_destroy(grpc_alarm *alarm, void *reserved) {
+void grpc_alarm_destroy(grpc_alarm* alarm, void* reserved) {
grpc_alarm_cancel(alarm, reserved);
GRPC_ALARM_UNREF(alarm, "alarm_destroy");
}