AC_CHECK_LIB(rt, clock_gettime, [AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Define if you have clock_gettime()])])
AC_CHECK_LIB(rt, clock_getres, [AC_DEFINE(HAVE_CLOCK_GETRES, 1, [Define if you have clock_getres()])])
AC_CHECK_LIB(rt, clock_nanosleep, [AC_DEFINE(HAVE_CLOCK_NANOSLEEP, 1, [Define if you have clock_nanosleep()])])
-AC_CHECK_LIB(pthread, pthread_setschedprio, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPRIO, 1, [Define if you have pthread_setschedprio()])])
+AC_CHECK_LIB(pthread, pthread_setschedparam, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM, 1, [Define if you have pthread_setschedparam()])])
AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket))
-Tue Oct 23 13:13:30 EDT 2012
+Wed Nov 7 10:37:54 CST 2012
if test "$threads" = "1"; then
APR_CHECK_DEFINE(PTHREAD_PROCESS_SHARED, pthread.h)
AC_CHECK_FUNCS(pthread_mutexattr_setpshared)
- AC_CHECK_LIB(pthread, pthread_setschedprio, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPRIO, 1, [Define if you have pthread_setschedprio()])])
+ AC_CHECK_LIB(pthread, pthread_setschedparam, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM, 1, [Define if you have pthread_setschedparam()])])
# Some systems have setpshared and define PROCESS_SHARED, but don't
# really support PROCESS_SHARED locks. So, we must validate that we
{
apr_status_t stat;
pthread_attr_t *temp;
+ pthread_t tt;
(*new) = (apr_thread_t *)apr_pcalloc(pool, sizeof(apr_thread_t));
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 {
-Fri Nov 2 13:36:06 CDT 2012
+Wed Nov 7 10:37:42 CST 2012
fi
AC_CHECK_HEADERS([fnmatch.h])
-AC_CHECK_LIB(pthread, pthread_setschedprio, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPRIO, 1, [Define if you have pthread_setschedprio()])])
+AC_CHECK_LIB(pthread, pthread_setschedparam, [AC_DEFINE(HAVE_PTHREAD_SETSCHEDPARAM, 1, [Define if you have pthread_setschedparam()])])
dnl dl is currently used only in testing
pthread_mutex_lock(arg.mutex);
if (pthread_create(&tid, &attr, su_pthread_port_clone_main, &arg) == 0) {
+#ifdef HAVE_PTHREAD_SETSCHEDPARAM
+ int policy;
+ struct sched_param param;
-#ifdef HAVE_PTHREAD_SETSCHEDPRIO
- pthread_setschedprio(tid, 99);
+ pthread_getschedparam(tid, &policy, ¶m);
+ param.sched_priority = 99;
+ pthread_setschedparam(tid, policy, ¶m);
#endif
pthread_cond_wait(arg.cv, arg.mutex);
switch_cache_db_release_db_handle(&dbh);
+
+ sofia_glue_fire_events(profile);
+
return ret;
}
*event = NULL;
}
+void sofia_glue_fire_events(sofia_profile_t *profile)
+{
+ void *pop = NULL;
+
+ while (profile->event_queue && switch_queue_trypop(profile->event_queue, &pop) == SWITCH_STATUS_SUCCESS && pop) {
+ switch_event_t *event = (switch_event_t *) pop;
+ switch_event_fire(&event);
+ }
+
+}
+
+void sofia_event_fire(sofia_profile_t *profile, switch_event_t **event)
+{
+ switch_queue_push(profile->event_queue, *event);
+ *event = NULL;
+}
+
/* For Emacs:
* Local Variables: