Revert "bpo-30860: Consolidate stateful runtime globals." (#3379)
Windows buildbots started failing due to include-related errors.
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h
index ea05b6f..268dec4 100644
--- a/Python/thread_pthread.h
+++ b/Python/thread_pthread.h
@@ -205,9 +205,8 @@
return PYTHREAD_INVALID_THREAD_ID;
#endif
#if defined(THREAD_STACK_SIZE)
- PyThreadState *tstate = PyThreadState_GET();
- size_t stacksize = tstate ? tstate->interp->pythread_stacksize : 0;
- tss = (stacksize != 0) ? stacksize : THREAD_STACK_SIZE;
+ tss = (_pythread_stacksize != 0) ? _pythread_stacksize
+ : THREAD_STACK_SIZE;
if (tss != 0) {
if (pthread_attr_setstacksize(&attrs, tss) != 0) {
pthread_attr_destroy(&attrs);
@@ -579,7 +578,7 @@
/* set to default */
if (size == 0) {
- PyThreadState_GET()->interp->pythread_stacksize = 0;
+ _pythread_stacksize = 0;
return 0;
}
@@ -596,7 +595,7 @@
rc = pthread_attr_setstacksize(&attrs, size);
pthread_attr_destroy(&attrs);
if (rc == 0) {
- PyThreadState_GET()->interp->pythread_stacksize = size;
+ _pythread_stacksize = size;
return 0;
}
}