Skip to content

Commit

Permalink
Set custom thread name (#1204)
Browse files Browse the repository at this point in the history
Forward the internally used thread name to OS for easier debugging.
  • Loading branch information
basicmaster authored Feb 2, 2025
1 parent 69d85b8 commit 4ad9a8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/socketworks.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,8 +709,10 @@ void *select_and_execute(void *arg) {
} else
strcpy(thread_info[thread_index].thread_name, "main");

select_timeout = SELECT_TIMEOUT;
tid = get_tid();
pthread_setname_np(tid, thread_info[thread_index].thread_name);

select_timeout = SELECT_TIMEOUT;
thread_info[thread_index].tid = tid;
les = 1;
es = 0;
Expand Down

0 comments on commit 4ad9a8d

Please sign in to comment.