$OpenBSD: patch-Python_thread_pthread_h,v 1.2 2002/05/11 21:35:13 matt Exp $

        This has been submitted to the Python team as patch 554841.

--- Python/thread_pthread.h.orig	Thu Jan 10 06:12:20 2002
+++ Python/thread_pthread.h	Mon Feb 25 15:37:53 2002
@@ -128,16 +128,21 @@ PyThread_start_new_thread(void (*func)(v
 {
 	pthread_t th;
 	int success;
-#ifdef PTHREAD_SYSTEM_SCHED_SUPPORTED
+#if defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) || defined(THREAD_STACK_SIZE)
 	pthread_attr_t attrs;
 #endif
         dprintf(("PyThread_start_new_thread called\n"));
 	if (!initialized)
 		PyThread_init_thread();
-#ifdef PTHREAD_SYSTEM_SCHED_SUPPORTED
+#if defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) || defined(THREAD_STACK_SIZE)
 	pthread_attr_init(&attrs);
+#endif
+#ifdef PTHREAD_SYSTEM_SCHED_SUPPORTED
 	pthread_attr_setscope(&attrs, PTHREAD_SCOPE_SYSTEM);
 #endif
+#ifdef THREAD_STACK_SIZE
+	pthread_attr_setstacksize(&attrs, THREAD_STACK_SIZE);
+#endif
 
 	success = pthread_create(&th, 
 #if defined(PY_PTHREAD_D4)
@@ -153,7 +158,7 @@ PyThread_start_new_thread(void (*func)(v
 				 func,
 				 arg
 #elif defined(PY_PTHREAD_STD)
-#ifdef PTHREAD_SYSTEM_SCHED_SUPPORTED
+#if defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) || defined(THREAD_STACK_SIZE)
 				 &attrs,
 #else
 				 (pthread_attr_t*)NULL,
