Skip to content

Commit 284f860

Browse files
committed
Don't lock and re-lock?
1 parent e441911 commit 284f860

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Objects/dictobject.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3085,7 +3085,7 @@ dict_subscript_lock_held(PyObject *self, PyObject *key)
30853085
if (hash == -1)
30863086
return NULL;
30873087
}
3088-
#ifdef Py_GIL_DISABLEDX
3088+
#ifdef Py_GIL_DISABLED
30893089
ix = _Py_dict_lookup_threadsafe(mp, key, hash, &value);
30903090
#else
30913091
ix = _Py_dict_lookup(mp, key, hash, &value);
@@ -3109,7 +3109,7 @@ dict_subscript_lock_held(PyObject *self, PyObject *key)
31093109
_PyErr_SetKeyError(key);
31103110
return NULL;
31113111
}
3112-
#ifdef Py_GIL_DISABLEDX
3112+
#ifdef Py_GIL_DISABLED
31133113
return value;
31143114
#else
31153115
return Py_NewRef(value);
@@ -3120,9 +3120,7 @@ static PyObject *
31203120
dict_subscript(PyObject *self, PyObject *key)
31213121
{
31223122
PyObject *res;
3123-
Py_BEGIN_CRITICAL_SECTION(self);
31243123
res = dict_subscript_lock_held(self, key);
3125-
Py_END_CRITICAL_SECTION();
31263124
return res;
31273125
}
31283126

0 commit comments

Comments
 (0)