summaryrefslogtreecommitdiff
path: root/thread_win32.c
diff options
context:
space:
mode:
authorNARUSE, Yui <naruse@airemix.jp>2021-05-22 21:36:27 +0900
committerNARUSE, Yui <naruse@airemix.jp>2021-05-26 15:14:11 +0900
commit46655156dcc37509dcb69fcd0717c110eb1c624a (patch)
treee21a75ebde64d8e7f05627fc990b62c47c8099c6 /thread_win32.c
parent88e3848fca69915a24657bcc26da1a65b659c6f3 (diff)
Add Thread#native_thread_id [Feature #17853]
Diffstat (limited to 'thread_win32.c')
-rw-r--r--thread_win32.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/thread_win32.c b/thread_win32.c
index 8b5120be3c..fc31c09ec3 100644
--- a/thread_win32.c
+++ b/thread_win32.c
@@ -835,6 +835,14 @@ native_set_thread_name(rb_thread_t *th)
{
}
+static VALUE
+native_thread_native_thread_id(rb_thread_t *th)
+{
+ DWORD tid = GetThreadId(th->thread_id);
+ if (tid == 0) rb_sys_fail("GetThreadId");
+ return ULONG2NUM(tid);
+}
+
#if USE_MJIT
static unsigned long __stdcall
mjit_worker(void *arg)