Bugzilla bug #4176: _POSIX_THREAD_PRIORITY_SCHEDULING is the feature-test
authorwtc%netscape.com
Tue, 23 Mar 1999 05:17:47 +0000
changeset 504 c9cdbb88898658c6d3c9b2a276d55e8cda19aa9c
parent 503 04319983cde729241937885a54cd381e010350ed
child 505 b87ab5edb9adca1d3eb8995070c4b8b4afc98756
push idunknown
push userunknown
push dateunknown
bugs4176
Bugzilla bug #4176: _POSIX_THREAD_PRIORITY_SCHEDULING is the feature-test macro for pthread_attr_setscope. Thanks to jon@eyrie.org (Jonathan Lennox) for the patch.
pr/src/pthreads/ptthread.c
--- a/pr/src/pthreads/ptthread.c
+++ b/pr/src/pthreads/ptthread.c
@@ -309,20 +309,17 @@ static PRThread* _PR_CreateThread(
         thred->priority = priority;
         if (PR_UNJOINABLE_THREAD == state)
             thred->state |= PT_THREAD_DETACHED;
 
         if (PR_LOCAL_THREAD == scope)
         	scope = PR_GLOBAL_THREAD;
 			
         if (PR_GLOBAL_BOUND_THREAD == scope) {
-			/*
-			 * should a Posix feature test be used here?
-			 */
-#ifdef PTHREAD_SCOPE_SYSTEM
+#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING)
     		rv = pthread_attr_setscope(&tattr, PTHREAD_SCOPE_SYSTEM);
 			if (rv) {
 				/*
 				 * system scope not supported
 				 */
         		scope = PR_GLOBAL_THREAD;
 				/*
 				 * reset scope