diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2021-12-07 21:03:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-07 21:03:47 (GMT) |
commit | 313f92a57bc3887026ec16adb536bb2b7580ce47 (patch) | |
tree | 65ddd994ed926fb46d2c24628b94f24667f6f385 /Python/thread_pthread.h | |
parent | 8262c96bcc1841188866c1b022d9087e89639d98 (diff) | |
download | cpython-313f92a57bc3887026ec16adb536bb2b7580ce47.zip cpython-313f92a57bc3887026ec16adb536bb2b7580ce47.tar.gz cpython-313f92a57bc3887026ec16adb536bb2b7580ce47.tar.bz2 |
bpo-46008: Move thread-related interpreter state into a sub-struct. (gh-29971)
This parallels _PyRuntimeState.interpreters. Doing this helps make it more clear what part of PyInterpreterState relates to its threads.
https://bugs.python.org/issue46008
Diffstat (limited to 'Python/thread_pthread.h')
-rw-r--r-- | Python/thread_pthread.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 12dad7e..c90ab25 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -1,4 +1,4 @@ -#include "pycore_interp.h" // _PyInterpreterState.pythread_stacksize +#include "pycore_interp.h" // _PyInterpreterState.threads.stacksize /* Posix threads interface */ @@ -262,7 +262,7 @@ PyThread_start_new_thread(void (*func)(void *), void *arg) #endif #if defined(THREAD_STACK_SIZE) PyThreadState *tstate = _PyThreadState_GET(); - size_t stacksize = tstate ? tstate->interp->pythread_stacksize : 0; + size_t stacksize = tstate ? tstate->interp->threads.stacksize : 0; tss = (stacksize != 0) ? stacksize : THREAD_STACK_SIZE; if (tss != 0) { if (pthread_attr_setstacksize(&attrs, tss) != 0) { @@ -764,7 +764,7 @@ _pythread_pthread_set_stacksize(size_t size) /* set to default */ if (size == 0) { - _PyInterpreterState_GET()->pythread_stacksize = 0; + _PyInterpreterState_GET()->threads.stacksize = 0; return 0; } @@ -781,7 +781,7 @@ _pythread_pthread_set_stacksize(size_t size) rc = pthread_attr_setstacksize(&attrs, size); pthread_attr_destroy(&attrs); if (rc == 0) { - _PyInterpreterState_GET()->pythread_stacksize = size; + _PyInterpreterState_GET()->threads.stacksize = size; return 0; } } |