summaryrefslogtreecommitdiffstats
path: root/Objects/clinic
diff options
context:
space:
mode:
authorDino Viehland <dinoviehland@meta.com>2024-02-21 01:08:14 (GMT)
committerGitHub <noreply@github.com>2024-02-21 01:08:14 (GMT)
commit54071460d76cdb3c805c8669dea7e82c70c5880f (patch)
treefda6006868f3d78b792aeb1e0dfd7a94908d9797 /Objects/clinic
parent176df09adbb42bbb50febd02346c32782d39dc4d (diff)
downloadcpython-54071460d76cdb3c805c8669dea7e82c70c5880f.zip
cpython-54071460d76cdb3c805c8669dea7e82c70c5880f.tar.gz
cpython-54071460d76cdb3c805c8669dea7e82c70c5880f.tar.bz2
gh-112075: Accessing a single element should optimistically avoid locking (#115109)
Makes accessing a single element thread safe and typically lock free
Diffstat (limited to 'Objects/clinic')
-rw-r--r--Objects/clinic/dictobject.c.h17
1 files changed, 1 insertions, 16 deletions
diff --git a/Objects/clinic/dictobject.c.h b/Objects/clinic/dictobject.c.h
index daaef21..fb46c4c 100644
--- a/Objects/clinic/dictobject.c.h
+++ b/Objects/clinic/dictobject.c.h
@@ -66,21 +66,6 @@ PyDoc_STRVAR(dict___contains____doc__,
#define DICT___CONTAINS___METHODDEF \
{"__contains__", (PyCFunction)dict___contains__, METH_O|METH_COEXIST, dict___contains____doc__},
-static PyObject *
-dict___contains___impl(PyDictObject *self, PyObject *key);
-
-static PyObject *
-dict___contains__(PyDictObject *self, PyObject *key)
-{
- PyObject *return_value = NULL;
-
- Py_BEGIN_CRITICAL_SECTION(self);
- return_value = dict___contains___impl(self, key);
- Py_END_CRITICAL_SECTION();
-
- return return_value;
-}
-
PyDoc_STRVAR(dict_get__doc__,
"get($self, key, default=None, /)\n"
"--\n"
@@ -327,4 +312,4 @@ dict_values(PyDictObject *self, PyObject *Py_UNUSED(ignored))
{
return dict_values_impl(self);
}
-/*[clinic end generated code: output=c8fda06bac5b05f3 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f3dd5f3fb8122aef input=a9049054013a1b77]*/