aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/channel/client_setup.c3
-rw-r--r--src/core/eventmanager/em.c4
-rw-r--r--src/core/eventmanager/em.h2
-rw-r--r--src/core/surface/call.c6
-rw-r--r--test/core/eventmanager/em_test.c7
5 files changed, 6 insertions, 16 deletions
diff --git a/src/core/channel/client_setup.c b/src/core/channel/client_setup.c
index c667e39d9c..ea256706fd 100644
--- a/src/core/channel/client_setup.c
+++ b/src/core/channel/client_setup.c
@@ -108,7 +108,6 @@ static void setup_initiate(grpc_transport_setup *sp) {
not to initiate again) */
static void setup_cancel(grpc_transport_setup *sp) {
grpc_client_setup *s = (grpc_client_setup *)sp;
- void *ignored;
gpr_mu_lock(&s->mu);
@@ -116,7 +115,7 @@ static void setup_cancel(grpc_transport_setup *sp) {
/* effectively cancels the current request (if any) */
s->active_request = NULL;
if (s->in_alarm) {
- grpc_em_alarm_cancel(&s->backoff_alarm, &ignored);
+ grpc_em_alarm_cancel(&s->backoff_alarm);
}
if (--s->refs == 0) {
gpr_mu_unlock(&s->mu);
diff --git a/src/core/eventmanager/em.c b/src/core/eventmanager/em.c
index e02d56c0a1..f16473b395 100644
--- a/src/core/eventmanager/em.c
+++ b/src/core/eventmanager/em.c
@@ -340,12 +340,10 @@ grpc_em_error grpc_em_alarm_add(grpc_em_alarm *alarm, gpr_timespec deadline) {
}
}
-grpc_em_error grpc_em_alarm_cancel(grpc_em_alarm *alarm, void **arg) {
+grpc_em_error grpc_em_alarm_cancel(grpc_em_alarm *alarm) {
grpc_em_activation_data *adata = &alarm->task.activation[GRPC_EM_TA_ONLY];
int trigger_old;
- *arg = adata->arg;
-
/* First check if this alarm has been triggered, atomically */
trigger_old =
gpr_atm_full_fetch_add(&alarm->triggered, ALARM_TRIGGER_INCREMENT);
diff --git a/src/core/eventmanager/em.h b/src/core/eventmanager/em.h
index 32d37a5b98..6f8bdedce2 100644
--- a/src/core/eventmanager/em.h
+++ b/src/core/eventmanager/em.h
@@ -136,7 +136,7 @@ grpc_em_error grpc_em_alarm_add(grpc_em_alarm *alarm, gpr_timespec deadline);
or from the activation (with status SUCCESS)
Requires: cancel() must happen after add() on a given alarm */
-grpc_em_error grpc_em_alarm_cancel(grpc_em_alarm *alarm, void **arg);
+grpc_em_error grpc_em_alarm_cancel(grpc_em_alarm *alarm);
/* ========================== grpc_em_fd ============================= */
diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index 63d408d2d5..02c224dabd 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -253,8 +253,7 @@ void grpc_call_internal_unref(grpc_call *c) {
void grpc_call_destroy(grpc_call *c) {
gpr_mu_lock(&c->read_mu);
if (c->have_alarm) {
- void *arg_was;
- grpc_em_alarm_cancel(&c->alarm, &arg_was);
+ grpc_em_alarm_cancel(&c->alarm);
c->have_alarm = 0;
}
gpr_mu_unlock(&c->read_mu);
@@ -774,8 +773,7 @@ void grpc_call_recv_finish(grpc_call_element *elem, int is_full_close) {
}
if (is_full_close) {
if (call->have_alarm) {
- void *arg_was;
- grpc_em_alarm_cancel(&call->alarm, &arg_was);
+ grpc_em_alarm_cancel(&call->alarm);
call->have_alarm = 0;
}
call->received_finish = 1;
diff --git a/test/core/eventmanager/em_test.c b/test/core/eventmanager/em_test.c
index 2bcfe86c3b..fceabff533 100644
--- a/test/core/eventmanager/em_test.c
+++ b/test/core/eventmanager/em_test.c
@@ -580,7 +580,6 @@ static void test_grpc_em_alarm() {
gpr_timespec alarm_deadline;
gpr_timespec followup_deadline;
- alarm_arg *cancel_arg = NULL;
alarm_arg arg;
alarm_arg arg2;
void *fdone;
@@ -649,7 +648,7 @@ static void test_grpc_em_alarm() {
GRPC_EM_OK);
GPR_ASSERT(grpc_em_alarm_add(&alarm_to_cancel,
gpr_time_add(tv2, gpr_now())) == GRPC_EM_OK);
- switch (grpc_em_alarm_cancel(&alarm_to_cancel, (void **)&cancel_arg)) {
+ switch (grpc_em_alarm_cancel(&alarm_to_cancel)) {
case GRPC_EM_OK:
gpr_log(GPR_INFO, "Alarm cancel succeeded");
break;
@@ -700,10 +699,6 @@ static void test_grpc_em_alarm() {
GPR_ASSERT(0);
}
- if (cancel_arg != &arg2) {
- gpr_log(GPR_ERROR, "Alarm cancel arg address wrong");
- GPR_ASSERT(0);
- }
if (fdone != (void *)&arg2.fcb_arg) {
gpr_log(GPR_ERROR, "Followup callback #2 not invoked properly %p %p", fdone,
&arg2.fcb_arg);