aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ruby/ext/grpc/rb_event_thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ruby/ext/grpc/rb_event_thread.c')
-rw-r--r--src/ruby/ext/grpc/rb_event_thread.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/ruby/ext/grpc/rb_event_thread.c b/src/ruby/ext/grpc/rb_event_thread.c
index b0bcb6f31e..281e41c9a8 100644
--- a/src/ruby/ext/grpc/rb_event_thread.c
+++ b/src/ruby/ext/grpc/rb_event_thread.c
@@ -31,15 +31,15 @@
typedef struct grpc_rb_event {
// callback will be called with argument while holding the GVL
- void (*callback)(void *);
- void *argument;
+ void (*callback)(void*);
+ void* argument;
- struct grpc_rb_event *next;
+ struct grpc_rb_event* next;
} grpc_rb_event;
typedef struct grpc_rb_event_queue {
- grpc_rb_event *head;
- grpc_rb_event *tail;
+ grpc_rb_event* head;
+ grpc_rb_event* tail;
gpr_mu mu;
gpr_cv cv;
@@ -50,8 +50,8 @@ typedef struct grpc_rb_event_queue {
static grpc_rb_event_queue event_queue;
-void grpc_rb_event_queue_enqueue(void (*callback)(void *), void *argument) {
- grpc_rb_event *event = gpr_malloc(sizeof(grpc_rb_event));
+void grpc_rb_event_queue_enqueue(void (*callback)(void*), void* argument) {
+ grpc_rb_event* event = gpr_malloc(sizeof(grpc_rb_event));
event->callback = callback;
event->argument = argument;
event->next = NULL;
@@ -66,8 +66,8 @@ void grpc_rb_event_queue_enqueue(void (*callback)(void *), void *argument) {
gpr_mu_unlock(&event_queue.mu);
}
-static grpc_rb_event *grpc_rb_event_queue_dequeue() {
- grpc_rb_event *event;
+static grpc_rb_event* grpc_rb_event_queue_dequeue() {
+ grpc_rb_event* event;
if (event_queue.head == NULL) {
event = NULL;
} else {
@@ -86,8 +86,8 @@ static void grpc_rb_event_queue_destroy() {
gpr_cv_destroy(&event_queue.cv);
}
-static void *grpc_rb_wait_for_event_no_gil(void *param) {
- grpc_rb_event *event = NULL;
+static void* grpc_rb_wait_for_event_no_gil(void* param) {
+ grpc_rb_event* event = NULL;
(void)param;
gpr_mu_lock(&event_queue.mu);
while (!event_queue.abort) {
@@ -102,7 +102,7 @@ static void *grpc_rb_wait_for_event_no_gil(void *param) {
return NULL;
}
-static void grpc_rb_event_unblocking_func(void *arg) {
+static void grpc_rb_event_unblocking_func(void* arg) {
(void)arg;
gpr_mu_lock(&event_queue.mu);
event_queue.abort = true;
@@ -113,10 +113,10 @@ static void grpc_rb_event_unblocking_func(void *arg) {
/* This is the implementation of the thread that handles auth metadata plugin
* events */
static VALUE grpc_rb_event_thread(VALUE arg) {
- grpc_rb_event *event;
+ grpc_rb_event* event;
(void)arg;
while (true) {
- event = (grpc_rb_event *)rb_thread_call_without_gvl(
+ event = (grpc_rb_event*)rb_thread_call_without_gvl(
grpc_rb_wait_for_event_no_gil, NULL, grpc_rb_event_unblocking_func,
NULL);
if (event == NULL) {