aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby
diff options
context:
space:
mode:
authorGravatar Alexander Polcyn <apolcyn@google.com>2017-03-13 17:57:47 -0700
committerGravatar Alexander Polcyn <apolcyn@google.com>2017-03-13 17:57:47 -0700
commit427ec5e433e006b7095e68029f5e99a6b11ce962 (patch)
tree9d7df5addc97aa54183ae3bb5631687d18c684a8 /src/ruby
parent69719089da708a4630a792131e8cf1ee579e15d5 (diff)
change if to while to avoid unsafe wakeup
Diffstat (limited to 'src/ruby')
-rw-r--r--src/ruby/ext/grpc/rb_channel.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ruby/ext/grpc/rb_channel.c b/src/ruby/ext/grpc/rb_channel.c
index 9a3f82c2b7..2489ec2fef 100644
--- a/src/ruby/ext/grpc/rb_channel.c
+++ b/src/ruby/ext/grpc/rb_channel.c
@@ -402,7 +402,7 @@ static void grpc_rb_channel_try_register_connection_polling(
// Note requires wrapper->wrapped, wrapper->safe_destroy_mu/cv initialized
static void grpc_rb_channel_safe_destroy(grpc_rb_channel *wrapper) {
gpr_mu_lock(&wrapper->safe_destroy_mu);
- if (!wrapper->safe_to_destroy) {
+ while (!wrapper->safe_to_destroy) {
wrapper->request_safe_destroy = 1;
gpr_cv_wait(&wrapper->safe_destroy_cv, &wrapper->safe_destroy_mu,
gpr_inf_future(GPR_CLOCK_REALTIME));