Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/ruby/ext/grpc/rb_event_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ typedef struct grpc_rb_event {
void* argument;

struct grpc_rb_event* next;
pid_t pid;
} grpc_rb_event;

typedef struct grpc_rb_event_queue {
Expand All @@ -57,6 +58,7 @@ 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->pid = getpid();
event->next = NULL;
gpr_mu_lock(&event_queue.mu);
if (event_queue.tail == NULL) {
Expand All @@ -81,6 +83,12 @@ static grpc_rb_event* grpc_rb_event_queue_dequeue() {
event_queue.head = event_queue.head->next;
}
}
if (event != NULL) {
fprintf(stderr, "DEQUEUED EVENT PID %d %s CURRENT PID %d\n", event->pid,
(event->pid == getpid() ? "==" : "!="), getpid());
} else {
fprintf(stderr, "DEQUEUED EVENT IS NULL\n");
}
return event;
}

Expand Down