Commit 969c0467 authored by Cedric Roux's avatar Cedric Roux

- Set priority for dumper thread

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4525 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 9999403e
...@@ -591,6 +591,9 @@ void itti_dump_thread_use_ring_buffer(void) ...@@ -591,6 +591,9 @@ void itti_dump_thread_use_ring_buffer(void)
int itti_dump_init(const char * const messages_definition_xml, const char * const dump_file_name) int itti_dump_init(const char * const messages_definition_xml, const char * const dump_file_name)
{ {
int i, ret; int i, ret;
struct sched_param scheduler_param;
scheduler_param.sched_priority = 10;
if (dump_file_name != NULL) if (dump_file_name != NULL)
{ {
...@@ -650,20 +653,25 @@ int itti_dump_init(const char * const messages_definition_xml, const char * cons ...@@ -650,20 +653,25 @@ int itti_dump_init(const char * const messages_definition_xml, const char * cons
ret = pthread_attr_init(&itti_dump_queue.attr); ret = pthread_attr_init(&itti_dump_queue.attr);
if (ret < 0) { if (ret < 0) {
ITTI_DUMP_ERROR("pthread_attr_init failed (%d:%s)\n", errno, strerror(errno)); ITTI_DUMP_ERROR("pthread_attr_init failed (%d:%s)\n", errno, strerror(errno));
return -1; DevAssert(0 == 1);
} }
ret = pthread_attr_setschedpolicy(&itti_dump_queue.attr, SCHED_RR); ret = pthread_attr_setschedpolicy(&itti_dump_queue.attr, SCHED_RR);
if (ret < 0) { if (ret < 0) {
ITTI_DUMP_ERROR("pthread_attr_setschedpolicy (SCHED_IDLE) failed (%d:%s)\n", errno, strerror(errno)); ITTI_DUMP_ERROR("pthread_attr_setschedpolicy (SCHED_IDLE) failed (%d:%s)\n", errno, strerror(errno));
return -1; DevAssert(0 == 1);
}
ret = pthread_attr_setschedparam(&itti_dump_queue.attr, &scheduler_param);
if (ret < 0) {
ITTI_DUMP_ERROR("pthread_attr_setschedparam failed (%d:%s)\n", errno, strerror(errno));
DevAssert(0 == 1);
} }
ret = pthread_create(&itti_dump_queue.itti_acceptor_thread, &itti_dump_queue.attr, ret = pthread_create(&itti_dump_queue.itti_acceptor_thread, &itti_dump_queue.attr,
&itti_dump_socket, (void *)messages_definition_xml); &itti_dump_socket, (void *)messages_definition_xml);
if (ret < 0) { if (ret < 0) {
ITTI_DUMP_ERROR("pthread_create failed (%d:%s)\n", errno, strerror(errno)); ITTI_DUMP_ERROR("pthread_create failed (%d:%s)\n", errno, strerror(errno));
return -1; DevAssert(0 == 1);
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment