Skip to content

Commit

Permalink
decode threadname with utf8-c8
Browse files Browse the repository at this point in the history
so that arbitrary buffer data as well as non-normalized
strings can be used if necessary for whatever terrible reason
  • Loading branch information
timo committed Jul 16, 2020
1 parent 8e75378 commit 1d52655
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/threads.c
Expand Up @@ -352,7 +352,7 @@ void MVM_thread_set_self_name(MVMThreadContext *tc, MVMString *name) {
MVMROOT(tc, name, {
while (acceptable_length > 0 && !success) {
MVMString *substring = MVM_string_substring(tc, name, 0, acceptable_length);
char *c_name = MVM_string_utf8_encode_C_string(tc, substring);
char *c_name = MVM_string_utf8_c8_encode_C_string(tc, substring);
/* pthread man page says names are allowed to be 15 bytes long... */
if (strlen(c_name) > 0 && pthread_setname_np(pthread_self(), c_name) == 0) {
success = 1;
Expand Down

0 comments on commit 1d52655

Please sign in to comment.