Skip to content

Commit

Permalink
show ractor info on non-single ractor mode
Browse files Browse the repository at this point in the history
Without this patch, Ruby doesn't show ractor's information when
there is only 1 ractor. However it is hard to read the log when
some ractors are created and terminated. This patch makes to keep
showing ractor's information on multi-ractor mode.
  • Loading branch information
ko1 committed Dec 6, 2020
1 parent 307732c commit 23f9447
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ ruby_debug_log(const char *file, int line, const char *func_name, const char *fm
}

// ractor information
if (GET_VM()->ractor.cnt > 1) {
if (ruby_single_main_ractor == NULL) {
rb_ractor_t *cr = GET_RACTOR();
if (r && len < MAX_DEBUG_LOG_MESSAGE_LEN) {
r = snprintf(buff + len, MAX_DEBUG_LOG_MESSAGE_LEN - len, "\tr:#%u/%u",
Expand Down

0 comments on commit 23f9447

Please sign in to comment.