]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
windows fixes for priority - needs to be revisited when apr and pthread versions...
authorJeff Lenk <jeff@jefflenk.com>
Tue, 2 Oct 2012 01:34:15 +0000 (20:34 -0500)
committerJeff Lenk <jeff@jefflenk.com>
Tue, 2 Oct 2012 01:34:15 +0000 (20:34 -0500)
libs/sofia-sip/libsofia-sip-ua/su/su_pthread_port.c
src/switch_apr.c

index 9899da6f47b4b34f63f3b48ae67b728e1d3b795f..90b335d49197b577db632ba5b50c41bf9c872544 100644 (file)
@@ -268,7 +268,10 @@ int su_pthreaded_port_start(su_port_create_f *create,
 
   pthread_mutex_lock(arg.mutex);
   if (pthread_create(&tid, &attr, su_pthread_port_clone_main, &arg) == 0) {
+#ifndef WIN32
+         /* this needs to be revisited when pthread for windows supports thread priority settings */
          pthread_setschedprio(tid, 99);
+#endif
     pthread_cond_wait(arg.cv, arg.mutex);
     thread_created = 1;
   }
index 64e066853ee567603b2732f0ad2882bb945e7ce5..2fcb2cd81e3080a1e220ed077790f9b9b4b5c213 100644 (file)
@@ -620,6 +620,14 @@ struct apr_threadattr_t {
        pthread_attr_t attr;
        int priority;
 };
+#else
+/* this needs to be revisited when apr for windows supports thread priority settings */
+/* search for WIN32 in this file */
+struct apr_threadattr_t {
+    apr_pool_t *pool;
+    apr_int32_t detach;
+    apr_size_t stacksize;
+};
 #endif
 
 
@@ -628,7 +636,9 @@ SWITCH_DECLARE(switch_status_t) switch_threadattr_create(switch_threadattr_t **
        switch_status_t status;
 
        if ((status = apr_threadattr_create(new_attr, pool)) == SWITCH_STATUS_SUCCESS) {
+#ifndef WIN32
                (*new_attr)->priority = SWITCH_PRI_NORMAL;
+#endif
        }
 
        return status;