]> git.sesse.net Git - vlc/commitdiff
Use POSIX TPS option only if present
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 21 Apr 2009 15:47:24 +0000 (18:47 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 21 Apr 2009 15:47:24 +0000 (18:47 +0300)
src/misc/threads.c

index 5dc08e1f8879bcbabf14cd16724fb555931f9bb4..46bf624e35fc5056f0a623ae3eab15020c44499e 100644 (file)
@@ -779,6 +779,8 @@ int vlc_clone (vlc_thread_t *p_handle, void * (*entry) (void *), void *data,
         sigaddset (&set, SIGPIPE); /* We don't want this one, really! */
         pthread_sigmask (SIG_BLOCK, &set, &oldset);
     }
+
+#if (_POSIX_THREAD_PRIORITY_SCHEDULING >= 0)
     {
         struct sched_param sp = { .sched_priority = priority, };
         int policy;
@@ -791,6 +793,9 @@ int vlc_clone (vlc_thread_t *p_handle, void * (*entry) (void *), void *data,
         pthread_attr_setschedpolicy (&attr, policy);
         pthread_attr_setschedparam (&attr, &sp);
     }
+#else
+    (void) priority;
+#endif
 
     /* The thread stack size.
      * The lower the value, the less address space per thread, the highest