lower stack and boost priority of sofia schedule thread
This commit is contained in:
parent
af2cebc153
commit
257bc9ff41
|
@ -1 +1 @@
|
|||
Tue Mar 8 12:40:45 CST 2011
|
||||
Tue Mar 22 15:01:49 CDT 2011
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue