From 19d692920d2d207c3aa891fc79aa5a93c17f84c6 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 26 Aug 2017 00:30:03 +0000 Subject: thread_win32.c: set thread name * thread_win32.c (native_set_another_thread_name): set thread name by SetThreadDescription. * win32/win32.c (rb_w32_set_thread_description): dynamically try SetThreadDescription. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59660 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'thread.c') diff --git a/thread.c b/thread.c index ea5172129a..2e0713e54f 100644 --- a/thread.c +++ b/thread.c @@ -2932,9 +2932,6 @@ rb_thread_getname(VALUE thread) static VALUE rb_thread_setname(VALUE thread, VALUE name) { -#ifdef SET_ANOTHER_THREAD_NAME - const char *s = ""; -#endif rb_thread_t *target_th = rb_thread_ptr(thread); if (!NIL_P(name)) { @@ -2946,16 +2943,11 @@ rb_thread_setname(VALUE thread, VALUE name) rb_enc_name(enc)); } name = rb_str_new_frozen(name); -#ifdef SET_ANOTHER_THREAD_NAME - s = RSTRING_PTR(name); -#endif } target_th->name = name; -#if defined(SET_ANOTHER_THREAD_NAME) if (threadptr_initialized(target_th)) { - SET_ANOTHER_THREAD_NAME(target_th->thread_id, s); + native_set_another_thread_name(target_th->thread_id, name); } -#endif return name; } -- cgit v1.2.3