37 lines
1.2 KiB
Plaintext
37 lines
1.2 KiB
Plaintext
|
$OpenBSD: patch-Python_thread_pthread_h,v 1.1 2002/02/25 21:25:37 matt Exp $
|
||
|
--- 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,
|