From 257bc9ff411803774353722a93386fdc314339b8 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 22 Mar 2011 15:02:10 -0500 Subject: [PATCH] lower stack and boost priority of sofia schedule thread --- libs/sofia-sip/.update | 2 +- libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/libs/sofia-sip/.update b/libs/sofia-sip/.update index a21313983b..ecc88483f6 100644 --- a/libs/sofia-sip/.update +++ b/libs/sofia-sip/.update @@ -1 +1 @@ -Tue Mar 8 12:40:45 CST 2011 +Tue Mar 22 15:01:49 CDT 2011 diff --git a/libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c b/libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c index a571b4dab6..dfcd9ac901 100644 --- a/libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c +++ b/libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c @@ -251,6 +251,8 @@ int su_pthreaded_port_start(su_port_create_f *create, int thread_created = 0; pthread_t tid; + pthread_attr_t attr; + struct sched_param param; arg.create = create; arg.parent = parent; @@ -258,11 +260,19 @@ int su_pthreaded_port_start(su_port_create_f *create, arg.init = init; arg.deinit = deinit; + pthread_attr_init(&attr); + pthread_attr_setstacksize(&attr, 244); + pthread_attr_getschedparam(&attr, ¶m); + param.sched_priority = 1; + pthread_attr_setschedparam(&attr, ¶m); + pthread_mutex_lock(arg.mutex); - if (pthread_create(&tid, NULL, su_pthread_port_clone_main, &arg) == 0) { + if (pthread_create(&tid, &attr, su_pthread_port_clone_main, &arg) == 0) { pthread_cond_wait(arg.cv, arg.mutex); thread_created = 1; } + pthread_attr_destroy(&attr); + pthread_mutex_unlock(arg.mutex); pthread_mutex_destroy(arg.mutex);