diff options
author | NARUSE, Yui <[email protected]> | 2021-05-22 21:36:27 +0900 |
---|---|---|
committer | NARUSE, Yui <[email protected]> | 2021-05-26 15:14:11 +0900 |
commit | 46655156dcc37509dcb69fcd0717c110eb1c624a (patch) | |
tree | e21a75ebde64d8e7f05627fc990b62c47c8099c6 /thread_win32.c | |
parent | 88e3848fca69915a24657bcc26da1a65b659c6f3 (diff) |
Add Thread#native_thread_id [Feature #17853]
Diffstat (limited to 'thread_win32.c')
-rw-r--r-- | thread_win32.c | 8 |
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) |