Add Thread#native_thread_id [Feature #17853]

This commit is contained in:
NARUSE, Yui 2021-05-22 21:36:27 +09:00
parent 88e3848fca
commit 46655156dc
5 changed files with 104 additions and 0 deletions

View file

@ -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)