mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-13 01:26:58 +00:00
fix some contention issues under really high load...That doesn't mean you need to push it this hard and bug me about it =p
This commit is contained in:
@@ -146,6 +146,7 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new,
|
||||
{
|
||||
apr_status_t stat;
|
||||
pthread_attr_t *temp;
|
||||
pthread_t tt;
|
||||
|
||||
(*new) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t));
|
||||
|
||||
@@ -173,15 +174,21 @@ APR_DECLARE(apr_status_t) apr_thread_create(apr_thread_t **new,
|
||||
return stat;
|
||||
}
|
||||
|
||||
if ((stat = pthread_create((*new)->td, temp, dummy_worker, (*new))) == 0) {
|
||||
if ((stat = pthread_create(&tt, temp, dummy_worker, (*new))) == 0) {
|
||||
|
||||
#ifdef HAVE_PTHREAD_SETSCHEDPRIO
|
||||
#ifdef HAVE_PTHREAD_SETSCHEDPARAM
|
||||
if (attr && attr->priority) {
|
||||
pthread_t *thread = (*new)->td;
|
||||
pthread_setschedprio(*thread, attr->priority);
|
||||
int policy;
|
||||
struct sched_param param = { 0 };
|
||||
|
||||
pthread_getschedparam(tt, &policy, ¶m);
|
||||
param.sched_priority = attr->priority;
|
||||
pthread_setschedparam(tt, policy, ¶m);
|
||||
}
|
||||
#endif
|
||||
|
||||
*(*new)->td = tt;
|
||||
|
||||
return APR_SUCCESS;
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user