summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/thread_pthread.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index 6910ccb..26120d6 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -135,17 +135,22 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
{
pthread_t th;
int success;
-#ifdef THREAD_STACK_SIZE
+#if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
pthread_attr_t attrs;
#endif
dprintf(("PyThread_start_new_thread called\n"));
if (!initialized)
PyThread_init_thread();
-#ifdef THREAD_STACK_SIZE
+#if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
pthread_attr_init(&attrs);
+#endif
+#ifdef THREAD_STACK_SIZE
pthread_attr_setstacksize(&attrs, THREAD_STACK_SIZE);
#endif
+#ifdef PTHREAD_SYSTEM_SCHED_SUPPORTED
+ pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM);
+#endif
success = pthread_create(&th,
#if defined(PY_PTHREAD_D4)
pthread_attr_default,
@@ -160,7 +165,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
func,
arg
#elif defined(PY_PTHREAD_STD)
-#ifdef THREAD_STACK_SIZE
+#if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED)
&attrs,
#else
(pthread_attr_t*)NULL,