pthread: Set name of thread for easier debugging on FreeBSD
This commit is contained in:
parent
727357e1bd
commit
4559e36dc1
1 changed files with 4 additions and 1 deletions
|
@ -97,9 +97,12 @@ thread_wrapper ( void *p )
|
|||
{
|
||||
struct thread_state *ts = p;
|
||||
|
||||
#ifdef PLATFORM_LINUX
|
||||
#if defined(PLATFORM_LINUX)
|
||||
/* Set name */
|
||||
prctl(PR_SET_NAME, ts->name);
|
||||
#elif defined(PLATFORM_FREEBSD)
|
||||
/* Set name of thread */
|
||||
pthread_set_name_np(pthread_self(), ts->name);
|
||||
#endif
|
||||
|
||||
/* Run */
|
||||
|
|
Loading…
Add table
Reference in a new issue