aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/ext
diff options
context:
space:
mode:
authorGravatar murgatroid99 <mlumish@google.com>2016-05-06 12:44:46 -0700
committerGravatar murgatroid99 <mlumish@google.com>2016-05-06 12:44:46 -0700
commit873e419cf73fa747a897cd8e06c8ffad6661efb0 (patch)
tree3ad6b070540a855f05bc60872be04b9da45fb2d6 /src/ruby/ext
parent6bbe369434f466e4694243305485e503eaf3ea02 (diff)
Added explanation about handling signals in C
Diffstat (limited to 'src/ruby/ext')
-rw-r--r--src/ruby/ext/grpc/rb_signal.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ruby/ext/grpc/rb_signal.c b/src/ruby/ext/grpc/rb_signal.c
index dd60b0f251..a9e512374b 100644
--- a/src/ruby/ext/grpc/rb_signal.c
+++ b/src/ruby/ext/grpc/rb_signal.c
@@ -44,6 +44,10 @@ static void (*old_sigterm_handler)(int);
static volatile bool signal_received = false;
+/* This has to be handled at the C level instead of Ruby, because Ruby signal
+ * handlers are constrained to run in the main interpreter thread. If that main
+ * thread is blocked on grpc_completion_queue_pluck, the signal handlers will
+ * never run */
static void handle_signal(int signum) {
signal_received = true;
if (signum == SIGINT) {