diff options
author | rh <rh@pkgsrc.org> | 2003-01-21 12:41:26 +0000 |
---|---|---|
committer | rh <rh@pkgsrc.org> | 2003-01-21 12:41:26 +0000 |
commit | f88c2be2bee3dba4ec0764ffa8f2516bcd1f9ddb (patch) | |
tree | a5a4838b7a78d3853941bfc0347858501c58b624 /devel/gnustep-objc/patches | |
parent | 38dd7f24d147637be40e368c71faa2f57416bb3a (diff) | |
download | pkgsrc-f88c2be2bee3dba4ec0764ffa8f2516bcd1f9ddb.tar.gz |
Make this work with native NetBSD threads.
Bump PKGREVISION.
Diffstat (limited to 'devel/gnustep-objc/patches')
-rw-r--r-- | devel/gnustep-objc/patches/patch-aa | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/devel/gnustep-objc/patches/patch-aa b/devel/gnustep-objc/patches/patch-aa index 21ff1d34201..665a73dd6ad 100644 --- a/devel/gnustep-objc/patches/patch-aa +++ b/devel/gnustep-objc/patches/patch-aa @@ -1,24 +1,42 @@ -$NetBSD: patch-aa,v 1.1.1.1 2002/09/27 10:44:47 rh Exp $ +$NetBSD: patch-aa,v 1.2 2003/01/21 12:41:27 rh Exp $ --- thr-posix.c.orig Sat May 5 03:23:21 2001 +++ thr-posix.c -@@ -96,6 +96,7 @@ __objc_thread_detach(void (*func)(void * +@@ -96,12 +96,17 @@ __objc_thread_detach(void (*func)(void * int __objc_thread_set_priority(int priority) { +#ifndef _PTH_PTHREAD_H_ pthread_t thread_id = pthread_self(); - int policy; +- int policy; ++ int policy = 0; struct sched_param params; -@@ -123,6 +124,7 @@ __objc_thread_set_priority(int priority) + int priority_min, priority_max; + ++#ifdef __NetBSD__ ++ if (pthread_attr_getschedparam(&_objc_thread_attribs, ¶ms) == 0) ++#else + if (pthread_getschedparam(thread_id, &policy, ¶ms) == 0) ++#endif + { + if ((priority_max = sched_get_priority_max(policy)) != 0) + return -1; +@@ -120,9 +125,14 @@ __objc_thread_set_priority(int priority) + * this should be a pointer to policy but pthread.h is universally + * at odds with this. + */ ++#ifdef __NetBSD__ ++ if (pthread_attr_setschedparam(&_objc_thread_attribs, ¶ms) == 0) ++#else if (pthread_setschedparam(thread_id, policy, ¶ms) == 0) ++#endif return 0; } +#endif return -1; } -@@ -130,6 +132,12 @@ __objc_thread_set_priority(int priority) +@@ -130,13 +140,24 @@ __objc_thread_set_priority(int priority) int __objc_thread_get_priority(void) { @@ -31,7 +49,11 @@ $NetBSD: patch-aa,v 1.1.1.1 2002/09/27 10:44:47 rh Exp $ int policy; struct sched_param params; -@@ -137,6 +145,7 @@ __objc_thread_get_priority(void) ++#ifdef __NetBSD__ ++ if (pthread_attr_getschedparam(&_objc_thread_attribs, ¶ms) == 0) ++#else + if (pthread_getschedparam(pthread_self(), &policy, ¶ms) == 0) ++#endif return params.sched_priority; else return -1; |