summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2022-04-22 21:19:03 +0900
committerKoichi Sasada <ko1@atdot.net>2022-04-23 03:08:27 +0900
commit03d21a4fb099da7c52e6591e17704c297871b7db (patch)
treedb2d58907b7c841d8ca15967f063d229bd9e37cc /thread.c
parent69d41480ec1c91691b79f106f5376a2e2cab3a82 (diff)
introduce struct `rb_native_thread`
`rb_thread_t` contained `native_thread_data_t` to represent thread implementation dependent data. This patch separates them and rename it `rb_native_thread` and point it from `rb_thraed_t`. Now, 1 Ruby thread (`rb_thread_t`) has 1 native thread (`rb_native_thread`).
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5836
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/thread.c b/thread.c
index 7881a8c05b..aeb1a6308d 100644
--- a/thread.c
+++ b/thread.c
@@ -339,7 +339,7 @@ rb_thread_s_debug_set(VALUE self, VALUE val)
#ifndef fill_thread_id_str
# define fill_thread_id_string(thid, buf) ((void *)(uintptr_t)(thid))
# define fill_thread_id_str(th) (void)0
-# define thread_id_str(th) ((void *)(uintptr_t)(th)->thread_id)
+# define thread_id_str(th) ((void *)(uintptr_t)(th)->nt->thread_id)
# define PRI_THREAD_ID "p"
#endif
@@ -3333,7 +3333,7 @@ rb_thread_setname(VALUE thread, VALUE name)
}
target_th->name = name;
if (threadptr_initialized(target_th)) {
- native_set_another_thread_name(target_th->thread_id, name);
+ native_set_another_thread_name(target_th->nt->thread_id, name);
}
return name;
}