summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2023-11-08 22:39:29 (GMT)
committerGitHub <noreply@github.com>2023-11-08 22:39:29 (GMT)
commit31c90d5838e8d6e4c47d98500a34810ccb33a6d4 (patch)
tree5be595b11ca17cf1f1bd5875a69a04b927f10dff /Objects
parent0b718e6407da65b838576a2459d630824ca62155 (diff)
downloadcpython-31c90d5838e8d6e4c47d98500a34810ccb33a6d4.zip
cpython-31c90d5838e8d6e4c47d98500a34810ccb33a6d4.tar.gz
cpython-31c90d5838e8d6e4c47d98500a34810ccb33a6d4.tar.bz2
gh-111569: Implement Python critical section API (gh-111571)
Critical sections are helpers to replace the global interpreter lock with finer grained locking. They provide similar guarantees to the GIL and avoid the deadlock risk that plain locking involves. Critical sections are implicitly ended whenever the GIL would be released. They are resumed when the GIL would be acquired. Nested critical sections behave as if the sections were interleaved.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/object.c b/Objects/object.c
index b561da7..b766278 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -2371,7 +2371,7 @@ new_reference(PyObject *op)
#else
op->ob_tid = _Py_ThreadId();
op->_padding = 0;
- op->ob_mutex = 0;
+ op->ob_mutex = (struct _PyMutex){ 0 };
op->ob_gc_bits = 0;
op->ob_ref_local = 1;
op->ob_ref_shared = 0;