aboutsummaryrefslogtreecommitdiffstats
path: root/debug.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2022-05-24 03:57:06 +0900
committerKoichi Sasada <ko1@atdot.net>2022-05-24 10:06:51 +0900
commitf3235ac09582c764086da28245a86753a100ba58 (patch)
treef2f687ba65f3eb49212f0ceb915f640cb9d57dfc /debug.c
parentd9984f39d32f4cd692a35f4d803f7754ea262805 (diff)
downloadruby-f3235ac09582c764086da28245a86753a100ba58.tar.gz
add `rb_th_serial()`
`rb_th_serial(th)` returns th's serial for debug print purpose.
Diffstat (limited to 'debug.c')
-rw-r--r--debug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/debug.c b/debug.c
index 3a6caca58a..6c9d6563db 100644
--- a/debug.c
+++ b/debug.c
@@ -474,7 +474,7 @@ ruby_debug_log(const char *file, int line, const char *func_name, const char *fm
// thread information
const rb_thread_t *th = GET_THREAD();
if (r && len < MAX_DEBUG_LOG_MESSAGE_LEN) {
- r = snprintf(buff + len, MAX_DEBUG_LOG_MESSAGE_LEN - len, "\tth:%u", (unsigned int)th->serial);
+ r = snprintf(buff + len, MAX_DEBUG_LOG_MESSAGE_LEN - len, "\tth:%u", rb_th_serial(th));
if (r < 0) rb_bug("ruby_debug_log returns %d\n", r);
len += r;
}