Correct the utilization of the _POSIX_THREAD_PRIORITY_SCHEDULING feature

test macro.

from Brad
This commit is contained in:
ajacoutot 2012-05-09 06:30:38 +00:00
parent ebd7a65a7b
commit 4ddcc497b1
4 changed files with 64 additions and 2 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.24 2012/04/28 14:08:54 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.25 2012/05/09 06:30:38 ajacoutot Exp $
COMMENT= multimedia player
DISTNAME= xine-ui-0.99.6
REVISION= 4
REVISION= 5
CATEGORIES= multimedia
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=xine/}
EXTRACT_SUFX= .tar.bz2

View File

@ -0,0 +1,20 @@
$OpenBSD: patch-src_xitk_panel_c,v 1.3 2012/05/09 06:30:38 ajacoutot Exp $
--- src/xitk/panel.c.orig Tue May 8 23:36:00 2012
+++ src/xitk/panel.c Tue May 8 23:36:47 2012
@@ -1555,14 +1555,14 @@ void panel_init (void) {
{
pthread_attr_t pth_attrs;
-#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING > 0)
struct sched_param pth_params;
#endif
pthread_attr_init(&pth_attrs);
/* this won't work on linux, freebsd 5.0 */
-#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING > 0)
pthread_attr_getschedparam(&pth_attrs, &pth_params);
pth_params.sched_priority = sched_get_priority_min(SCHED_OTHER);
pthread_attr_setschedparam(&pth_attrs, &pth_params);

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-src_xitk_xine-toolkit_label_c,v 1.5 2012/05/09 06:30:38 ajacoutot Exp $
--- src/xitk/xine-toolkit/label.c.orig Fri Dec 18 19:34:22 2009
+++ src/xitk/xine-toolkit/label.c Tue May 8 23:41:57 2012
@@ -319,7 +319,7 @@ static void label_setup_label(xitk_widget_t *w, const
if(label_len > private_data->length) {
pthread_attr_t pth_attrs;
-#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING > 0)
struct sched_param pth_params;
#endif
@@ -327,7 +327,7 @@ static void label_setup_label(xitk_widget_t *w, const
pthread_attr_init(&pth_attrs);
-#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING > 0)
pthread_attr_getschedparam(&pth_attrs, &pth_params);
pth_params.sched_priority = sched_get_priority_min(SCHED_OTHER);
pthread_attr_setschedparam(&pth_attrs, &pth_params);

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-src_xitk_xine-toolkit_tips_c,v 1.5 2012/05/09 06:30:38 ajacoutot Exp $
--- src/xitk/xine-toolkit/tips.c.orig Fri Dec 18 19:34:22 2009
+++ src/xitk/xine-toolkit/tips.c Tue May 8 23:43:50 2012
@@ -222,7 +222,7 @@ void xitk_tips_init(Display *disp) {
if(!tips.running) {
pthread_attr_t pth_attrs;
-#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING > 0)
struct sched_param pth_params;
#endif
@@ -240,7 +240,7 @@ void xitk_tips_init(Display *disp) {
pthread_attr_init(&pth_attrs);
-#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING
+#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) && (_POSIX_THREAD_PRIORITY_SCHEDULING > 0)
pthread_attr_getschedparam(&pth_attrs, &pth_params);
pth_params.sched_priority = sched_get_priority_min(SCHED_OTHER);
pthread_attr_setschedparam(&pth_attrs, &pth_params);