diff options
author | murgatroid99 <mlumish@google.com> | 2016-06-30 13:58:18 -0700 |
---|---|---|
committer | murgatroid99 <mlumish@google.com> | 2016-06-30 13:58:18 -0700 |
commit | 5756c6862bc4e65102ff5409d46e85fbdb09ccea (patch) | |
tree | e78b6db26dfb082e744f0a33d260f2c3e7ab3354 /src | |
parent | 9acc40f9b6753a0d43434b30393c4996c8002b28 (diff) |
Added a comment about Ruby queue destruction
Diffstat (limited to 'src')
-rw-r--r-- | src/ruby/ext/grpc/rb_completion_queue.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ruby/ext/grpc/rb_completion_queue.c b/src/ruby/ext/grpc/rb_completion_queue.c index 87ff9083ff..fd75d2f691 100644 --- a/src/ruby/ext/grpc/rb_completion_queue.c +++ b/src/ruby/ext/grpc/rb_completion_queue.c @@ -72,6 +72,10 @@ static void *grpc_rb_completion_queue_pluck_no_gil(void *param) { /* Helper function to free a completion queue. */ void grpc_rb_completion_queue_destroy(grpc_completion_queue *cq) { + /* Every function that adds an event to a queue also synchronously plucks + that event from the queue, and holds a reference to the Ruby object that + holds the queue, so we only get to this point if all of those functions + have completed, and the queue is empty */ grpc_completion_queue_shutdown(cq); grpc_completion_queue_destroy(cq); } |