summaryrefslogtreecommitdiff
path: root/Python/thread_os2.h
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2006-06-04 23:52:47 +0000
committerTim Peters <tim.peters@gmail.com>2006-06-04 23:52:47 +0000
commit28eeefe566d77cd3af3d675c4f2216c5033fe538 (patch)
tree7fec63fcf38c5dbe611860fb74e8c49206d2e581 /Python/thread_os2.h
parentc7d14452a4ed303d38498cc16c3cfc0beed9b843 (diff)
downloadcpython-git-28eeefe566d77cd3af3d675c4f2216c5033fe538.tar.gz
Revert revisions:
46640 Patch #1454481: Make thread stack size runtime tunable. 46647 Markup fix The first is causing many buildbots to fail test runs, and there are multiple causes with seemingly no immediate prospects for repairing them. See python-dev discussion. Note that a branch can (and should) be created for resolving these problems, like svn copy svn+ssh://svn.python.org/python/trunk -r46640 svn+ssh://svn.python.org/python/branches/NEW_BRANCH followed by merging rev 46647 to the new branch.
Diffstat (limited to 'Python/thread_os2.h')
-rw-r--r--Python/thread_os2.h42
1 files changed, 1 insertions, 41 deletions
diff --git a/Python/thread_os2.h b/Python/thread_os2.h
index 11ceecd267..86e91c1e1a 100644
--- a/Python/thread_os2.h
+++ b/Python/thread_os2.h
@@ -14,13 +14,10 @@
long PyThread_get_thread_ident(void);
#endif
-/* default thread stack size of 64kB */
#if !defined(THREAD_STACK_SIZE)
#define THREAD_STACK_SIZE 0x10000
#endif
-#define OS2_STACKSIZE(x) (x ? x : THREAD_STACK_SIZE)
-
/*
* Initialization of the C package, should not be needed.
*/
@@ -38,10 +35,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg)
int aThread;
int success = 0;
- aThread = _beginthread(func,
- NULL,
- OS2_STACKSIZE(_pythread_stacksize),
- arg);
+ aThread = _beginthread(func, NULL, THREAD_STACK_SIZE, arg);
if (aThread == -1) {
success = -1;
@@ -281,37 +275,3 @@ PyThread_release_lock(PyThread_type_lock aLock)
DosExitCritSec();
#endif
}
-
-/* minimum/maximum thread stack sizes supported */
-#define THREAD_MIN_STACKSIZE 0x8000 /* 32kB */
-#define THREAD_MAX_STACKSIZE 0x2000000 /* 32MB */
-
-/* set the thread stack size.
- * Return 1 if an exception is pending, 0 otherwise.
- */
-static int
-_pythread_os2_set_stacksize(size_t size)
-{
- /* set to default */
- if (size == 0) {
- _pythread_stacksize = 0;
- return 0;
- }
-
- /* valid range? */
- if (size >= THREAD_MIN_STACKSIZE && size < THREAD_MAX_STACKSIZE) {
- _pythread_stacksize = size;
- return 0;
- }
- else {
- char warning[128];
- snprintf(warning,
- 128,
- "thread stack size of %#x bytes not supported on OS/2",
- size);
- return PyErr_Warn(PyExc_RuntimeWarning, warning);
- }
-}
-
-#undef THREAD_SET_STACKSIZE
-#define THREAD_SET_STACKSIZE(x) _pythread_os2_set_stacksize(x)