summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authorNARUSE, Yui <[email protected]>2021-05-22 21:36:27 +0900
committerNARUSE, Yui <[email protected]>2021-05-26 15:14:11 +0900
commit46655156dcc37509dcb69fcd0717c110eb1c624a (patch)
treee21a75ebde64d8e7f05627fc990b62c47c8099c6 /vm_core.h
parent88e3848fca69915a24657bcc26da1a65b659c6f3 (diff)
Add Thread#native_thread_id [Feature #17853]
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/vm_core.h b/vm_core.h
index 2d92d9b9f8..72e2bcb6fb 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -942,6 +942,10 @@ struct rb_ext_config {
typedef struct rb_ractor_struct rb_ractor_t;
+#if defined(__linux__) || defined(__FreeBSD__)
+# define RB_THREAD_T_HAS_NATIVE_ID
+#endif
+
typedef struct rb_thread_struct {
struct list_node lt_node; // managed by a ractor
VALUE self;
@@ -964,6 +968,9 @@ typedef struct rb_thread_struct {
#ifdef NON_SCALAR_THREAD_ID
rb_thread_id_string_t thread_id_string;
#endif
+#ifdef RB_THREAD_T_HAS_NATIVE_ID
+ int tid;
+#endif
BITFIELD(enum rb_thread_status, status, 2);
/* bit flags */
unsigned int to_kill : 1;