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:
Anthony Minessale
2012-11-07 14:53:10 -06:00
parent 0160072adc
commit 6627dc8696
8 changed files with 42 additions and 11 deletions

View File

@@ -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, &param);
param.sched_priority = attr->priority;
pthread_setschedparam(tt, policy, &param);
}
#endif
*(*new)->td = tt;
return APR_SUCCESS;
}
else {