summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2018-06-02 00:45:20 (GMT)
committerGitHub <noreply@github.com>2018-06-02 00:45:20 (GMT)
commit63799136e6c0491bb5d6f4a234d5a775db3458db (patch)
tree73b6425dbddf05b042b2c48f9053232348fd3e0f /Include
parent29996a1c4e8bd6dde6adce2b44d11a0982a47a3a (diff)
downloadcpython-63799136e6c0491bb5d6f4a234d5a775db3458db.zip
cpython-63799136e6c0491bb5d6f4a234d5a775db3458db.tar.gz
cpython-63799136e6c0491bb5d6f4a234d5a775db3458db.tar.bz2
bpo-33615: Re-enable a subinterpreter test. (gh-7251)
For bpo-32604 I added extra subinterpreter-related tests (see #6914), which caused a few buildbots to crash. This patch fixes the crash by ensuring that refcounts in channels are handled properly.
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pystate.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/Include/internal/pystate.h b/Include/internal/pystate.h
index da642c6..70e0666 100644
--- a/Include/internal/pystate.h
+++ b/Include/internal/pystate.h
@@ -80,7 +80,7 @@ struct _xid;
// _PyCrossInterpreterData is similar to Py_buffer as an effectively
// opaque struct that holds data outside the object machinery. This
-// is necessary to pass between interpreters in the same process.
+// is necessary to pass safely between interpreters in the same process.
typedef struct _xid {
// data is the cross-interpreter-safe derivation of a Python object
// (see _PyObject_GetCrossInterpreterData). It will be NULL if the
@@ -89,8 +89,9 @@ typedef struct _xid {
// obj is the Python object from which the data was derived. This
// is non-NULL only if the data remains bound to the object in some
// way, such that the object must be "released" (via a decref) when
- // the data is released. In that case it is automatically
- // incref'ed (to match the automatic decref when releaed).
+ // the data is released. In that case the code that sets the field,
+ // likely a registered "crossinterpdatafunc", is responsible for
+ // ensuring it owns the reference (i.e. incref).
PyObject *obj;
// interp is the ID of the owning interpreter of the original
// object. It corresponds to the active interpreter when