Add automatically-generated names to threads

This commit is contained in:
RichardG867
2024-01-09 20:13:16 -03:00
parent ce342400eb
commit 67c84f1ae6
9 changed files with 107 additions and 6 deletions

View File

@@ -32,7 +32,7 @@ thread_run_wrapper(thread_param *arg)
}
thread_t *
thread_create(void (*thread_rout)(void *param), void *param)
thread_create(void (*thread_rout)(void *param), void *param, const char *name)
{
pthread_t *thread = malloc(sizeof(pthread_t));
thread_param *thrparam = malloc(sizeof(thread_param));
@@ -40,6 +40,7 @@ thread_create(void (*thread_rout)(void *param), void *param)
thrparam->param = param;
pthread_create(thread, NULL, (void *(*) (void *) ) thread_run_wrapper, thrparam);
plat_set_thread_name(thread, name);
return thread;
}