mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.14] gh-116738: Add critical section to dbm/gdbm context manager (gh-140391) (gh-140459)
(cherry picked from commit d51be28876)
Co-authored-by: Alper <alperyoney@fb.com>
This commit is contained in:
parent
9d547dab0b
commit
01b52ea5c0
2 changed files with 10 additions and 2 deletions
|
|
@ -523,8 +523,12 @@ dbm__enter__(PyObject *self, PyObject *Py_UNUSED(dummy))
|
|||
static PyObject *
|
||||
dbm__exit__(PyObject *self, PyObject *Py_UNUSED(args))
|
||||
{
|
||||
PyObject *result;
|
||||
dbmobject *dp = dbmobject_CAST(self);
|
||||
return _dbm_dbm_close_impl(dp);
|
||||
Py_BEGIN_CRITICAL_SECTION(self);
|
||||
result = _dbm_dbm_close_impl(dp);
|
||||
Py_END_CRITICAL_SECTION();
|
||||
return result;
|
||||
}
|
||||
|
||||
static PyMethodDef dbm_methods[] = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue