summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2018-02-17 01:53:40 (GMT)
committerGitHub <noreply@github.com>2018-02-17 01:53:40 (GMT)
commit4c6955e2b0ccf88c705f8d1fac685a8e65f9699e (patch)
tree56d0f3ce551117d3630c6efad21244385cbd9697 /Include
parentbd093355a6aaf2f4ca3ed153e195da57870a55eb (diff)
downloadcpython-4c6955e2b0ccf88c705f8d1fac685a8e65f9699e.zip
cpython-4c6955e2b0ccf88c705f8d1fac685a8e65f9699e.tar.gz
cpython-4c6955e2b0ccf88c705f8d1fac685a8e65f9699e.tar.bz2
bpo-32604: Clean up created subinterpreters before runtime finalization. (gh-5709)
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pystate.h4
-rw-r--r--Include/pystate.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/Include/internal/pystate.h b/Include/internal/pystate.h
index 2b60b25..da642c6 100644
--- a/Include/internal/pystate.h
+++ b/Include/internal/pystate.h
@@ -69,6 +69,10 @@ PyAPI_FUNC(void) _PyPathConfig_Clear(_PyPathConfig *config);
PyAPI_FUNC(PyInterpreterState *) _PyInterpreterState_LookUpID(PY_INT64_T);
+PyAPI_FUNC(int) _PyInterpreterState_IDInitref(PyInterpreterState *);
+PyAPI_FUNC(void) _PyInterpreterState_IDIncref(PyInterpreterState *);
+PyAPI_FUNC(void) _PyInterpreterState_IDDecref(PyInterpreterState *);
+
/* cross-interpreter data */
diff --git a/Include/pystate.h b/Include/pystate.h
index a19c1ed..29d7148 100644
--- a/Include/pystate.h
+++ b/Include/pystate.h
@@ -8,6 +8,8 @@
extern "C" {
#endif
+#include "pythread.h"
+
/* This limitation is for performance and simplicity. If needed it can be
removed (with effort). */
#define MAX_CO_EXTRA_USERS 255
@@ -111,6 +113,8 @@ typedef struct _is {
struct _ts *tstate_head;
int64_t id;
+ int64_t id_refcount;
+ PyThread_type_lock id_mutex;
PyObject *modules;
PyObject *modules_by_index;