diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-26 00:30:03 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-08-26 00:30:03 +0000 |
commit | 19d692920d2d207c3aa891fc79aa5a93c17f84c6 (patch) | |
tree | 123927bc19e68863da3b0ba2a1fb8c0bbed106de /thread_pthread.c | |
parent | c150c7877dc704efe369976231c97e3823084191 (diff) | |
download | ruby-19d692920d2d207c3aa891fc79aa5a93c17f84c6.tar.gz |
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
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index 18170c8e16..242b48f15d 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -1540,6 +1540,17 @@ native_set_thread_name(rb_thread_t *th) #endif } +static VALUE +native_set_another_thread_name(rb_nativethread_id_t thread_id, VALUE name) +{ +#ifdef SET_ANOTHER_THREAD_NAME + const char *s = ""; + if (!NIL_P(name)) s = RSTRING_PTR(name); + SET_ANOTHER_THREAD_NAME(thread_id, s); +#endif + return name; +} + static void * thread_timer(void *p) { |