Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Prevent a deadlock when multiple threads start, stop and use :mod:`tracemalloc`
simultaneously.
2 changes: 1 addition & 1 deletion Python/tracemalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static int _PyTraceMalloc_TraceRef(PyObject *op, PyRefTracerEvent event,
the GIL held from PyMem_RawFree(). It cannot acquire the lock because it
would introduce a deadlock in _PyThreadState_DeleteCurrent(). */
#define tables_lock _PyRuntime.tracemalloc.tables_lock
#define TABLES_LOCK() PyMutex_LockFlags(&tables_lock, _Py_LOCK_DONT_DETACH)
#define TABLES_LOCK() PyMutex_Lock(&tables_lock)
#define TABLES_UNLOCK() PyMutex_Unlock(&tables_lock)


Expand Down
Loading