[vlc-devel] commit: Use POSIX TPS option only if present ( Rémi Denis-Courmont )

git version control git at videolan.org
Tue Apr 21 17:48:54 CEST 2009


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Apr 21 18:47:24 2009 +0300| [25253739d5dfb7d494054b8fadec5b8666ab5a9f] | committer: Rémi Denis-Courmont 

Use POSIX TPS option only if present

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=25253739d5dfb7d494054b8fadec5b8666ab5a9f
---

 src/misc/threads.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/misc/threads.c b/src/misc/threads.c
index 5dc08e1..46bf624 100644
--- a/src/misc/threads.c
+++ b/src/misc/threads.c
@@ -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




More information about the vlc-devel mailing list