pkgsrc/lang/python21-pth/patches/patch-ba
drochner 91070a1ea3 more pth hackery:
increase stack size for created threads, and set the JOINABLE attribute
to "false" (nothing will join() them) to avoid a ressource leak
"works better now"
2002-09-06 17:01:08 +00:00

32 lines
769 B
Text

$NetBSD: patch-ba,v 1.1 2002/09/06 17:01:08 drochner Exp $
--- Python/thread_pth.h.orig Thu Oct 12 22:58:32 2000
+++ Python/thread_pth.h Fri Sep 6 18:34:12 2002
@@ -30,6 +30,8 @@
#define CHECK_STATUS(name) if (status == -1) { printf("%d ", status); perror(name); error = 1; }
+pth_attr_t PyThread_attr;
+
/*
* Initialization.
*/
@@ -37,6 +39,9 @@
static void PyThread__init_thread(void)
{
pth_init();
+ PyThread_attr = pth_attr_new();
+ pth_attr_set(PyThread_attr, PTH_ATTR_STACK_SIZE, 1<<18);
+ pth_attr_set(PyThread_attr, PTH_ATTR_JOINABLE, FALSE);
}
/*
@@ -51,7 +56,7 @@
if (!initialized)
PyThread_init_thread();
- th = pth_spawn(PTH_ATTR_DEFAULT,
+ th = pth_spawn(PyThread_attr,
(void* (*)(void *))func,
(void *)arg
);