patches13/0008-name-pthreads-easier-debugging.patch
git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7054 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -709,6 +709,9 @@ int itti_create_task(task_id_t task_id, void *(*start_routine)(void *), void *ar
|
||||
|
||||
result = pthread_create (&itti_desc.threads[thread_id].task_thread, NULL, start_routine, args_p);
|
||||
AssertFatal (result >= 0, "Thread creation for task %d, thread %d failed (%d)!\n", task_id, thread_id, result);
|
||||
char name[16];
|
||||
snprintf( name, sizeof(name), "ITTI %d", thread_id );
|
||||
pthread_setname_np( itti_desc.threads[thread_id].task_thread, name );
|
||||
|
||||
itti_desc.created_tasks ++;
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
* @author Sebastien Roux <sebastien.roux@eurecom.fr>
|
||||
*/
|
||||
|
||||
#define _GNU_SOURCE // required for pthread_setname_np()
|
||||
#include <pthread.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -845,6 +846,7 @@ int itti_dump_init(const char * const messages_definition_xml, const char * cons
|
||||
if (ret < 0) {
|
||||
AssertFatal (0, "pthread_create failed (%d:%s)!\n", errno, strerror(errno));
|
||||
}
|
||||
pthread_setname_np( itti_dump_queue.itti_acceptor_thread, "ITTI acceptor" );
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user