Skip to content

Commit

Permalink
thread_pthread.c: set MJIT thread name
Browse files Browse the repository at this point in the history
thread_win32.c: ditto
  • Loading branch information
k0kubun committed Dec 28, 2017
1 parent 315b8df commit ddb2ff7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion thread_pthread.c
Expand Up @@ -1798,6 +1798,9 @@ mjit_worker(void *arg)
if (pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) != 0) {
fprintf(stderr, "Cannot enable cancelation in MJIT worker\n");
}
#ifdef SET_CURRENT_THREAD_NAME
SET_CURRENT_THREAD_NAME("ruby-mjitworker"); /* 16 byte including NUL */
#endif
worker_func();
return NULL;
}
Expand All @@ -1816,7 +1819,8 @@ rb_thread_create_mjit_thread(void (*child_hook)(void), void (*worker_func)(void)
/* jit_worker thread is not to be joined */
pthread_detach(worker_pid);
return TRUE;
} else {
}
else {
return FALSE;
}
}
Expand Down
1 change: 1 addition & 0 deletions thread_win32.c
Expand Up @@ -781,6 +781,7 @@ static unsigned long __stdcall
mjit_worker(void *arg)
{
void (*worker_func)(void) = arg;
rb_w32_set_thread_description(GetCurrentThread(), L"ruby-mjitworker");
worker_func();
return 0;
}
Expand Down

0 comments on commit ddb2ff7

Please sign in to comment.