File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1389,6 +1389,16 @@ \section{Type Objects \label{type-structs}}
13891389 field.
13901390\end {cmemberdesc }
13911391
1392+ Also, note that, in a garbage collected Python, tp_dealloc may be
1393+ called from any Python thread, not just the thread which created the
1394+ object (if the object becomes part of a refcount cycle, that cycle
1395+ might be collected by a garbage collection on any thread). This is
1396+ not a problem for Python API calls, since the thread on which
1397+ tp_dealloc is called will own the Global Interpreter Lock (GIL).
1398+ However, if the object being destroyed in turn destroys objects from
1399+ some other C or C++ library, care should be taken to ensure that
1400+ destroying those objects on the thread which called tp_dealloc will
1401+ not violate any assumptions of the library.
13921402
13931403\section {Mapping Object Structures \label {mapping-structs } }
13941404
You can’t perform that action at this time.
0 commit comments