Skip to content
Snippets Groups Projects
Commit 06d4edd2 authored by Alexander Polcyn's avatar Alexander Polcyn
Browse files

fix setting of time_check_increment in watch conn state loop

parent 5b881460
No related branches found
No related tags found
No related merge requests found
...@@ -259,9 +259,7 @@ static void *watch_channel_state_without_gvl(void *arg) { ...@@ -259,9 +259,7 @@ static void *watch_channel_state_without_gvl(void *arg) {
grpc_rb_channel *wrapper = stack->wrapper; grpc_rb_channel *wrapper = stack->wrapper;
int last_state = stack->last_state; int last_state = stack->last_state;
void *return_value = (void*)0; void *return_value = (void*)0;
gpr_timespec time_check_increment = gpr_time_add( gpr_timespec time_check_increment;
gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_millis(20, GPR_TIMESPAN));
gpr_mu_lock(&wrapper->channel_mu); gpr_mu_lock(&wrapper->channel_mu);
while(wrapper->current_connectivity_state == last_state && while(wrapper->current_connectivity_state == last_state &&
...@@ -269,6 +267,8 @@ static void *watch_channel_state_without_gvl(void *arg) { ...@@ -269,6 +267,8 @@ static void *watch_channel_state_without_gvl(void *arg) {
!wrapper->safe_to_destroy && !wrapper->safe_to_destroy &&
!wrapper->abort_watch_connectivity_state && !wrapper->abort_watch_connectivity_state &&
gpr_time_cmp(deadline, gpr_now(GPR_CLOCK_REALTIME)) > 0) { gpr_time_cmp(deadline, gpr_now(GPR_CLOCK_REALTIME)) > 0) {
time_check_increment = gpr_time_add(
gpr_now(GPR_CLOCK_REALTIME), gpr_time_from_millis(20, GPR_TIMESPAN));
gpr_cv_wait(&wrapper->channel_cv, &wrapper->channel_mu, time_check_increment); gpr_cv_wait(&wrapper->channel_cv, &wrapper->channel_mu, time_check_increment);
} }
if (wrapper->current_connectivity_state != last_state) { if (wrapper->current_connectivity_state != last_state) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment