static void *dummy_worker(void *opaque)
{
apr_thread_t *thread = (apr_thread_t*)opaque;
+
+#ifdef HAVE_PTHREAD_SETSCHEDPARAM
+ if (thread->priority) {
+ int policy;
+ struct sched_param param = { 0 };
+ pthread_t tt = pthread_self();
+
+ pthread_getschedparam(tt, &policy, ¶m);
+ param.sched_priority = thread->priority;
+ pthread_setschedparam(tt, policy, ¶m);
+ }
+#endif
+
return thread->func(thread, thread->data);
}
return stat;
}
- if ((stat = pthread_create(&tt, temp, dummy_worker, (*new))) == 0) {
-
-#ifdef HAVE_PTHREAD_SETSCHEDPARAM
- if (attr && 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
+ if (attr && attr->priority) {
+ (*new)->priority = attr->priority;
+ }
+ if ((stat = pthread_create(&tt, temp, dummy_worker, (*new))) == 0) {
*(*new)->td = tt;
return APR_SUCCESS;