[前][次][番号順一覧][スレッド一覧]

ruby-changes:63976

From: Koichi <ko1@a...>
Date: Mon, 7 Dec 2020 08:28:58 +0900 (JST)
Subject: [ruby-changes:63976] 23f9447429 (master): show ractor info on non-single ractor mode

https://git.ruby-lang.org/ruby.git/commit/?id=23f9447429

From 23f9447429a1bbb262aa19afd9a2a1ad0eba8ca6 Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@a...>
Date: Sat, 5 Dec 2020 05:38:50 +0900
Subject: show ractor info on non-single ractor mode

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.

diff --git a/debug.c b/debug.c
index deec382..5548a00 100644
--- a/debug.c
+++ b/debug.c
@@ -424,7 +424,7 @@ ruby_debug_log(const char *file, int line, const char *func_name, const char *fm https://github.com/ruby/ruby/blob/trunk/debug.c#L424
     }
 
     // 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",
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]