Add automatically-generated names to threads
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user