Skip to content

gh-132551: make BytesIO object free-thread safe #132616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
May 8, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
remove dummies from _lock_held functions
  • Loading branch information
tom-pytel committed Apr 17, 2025
commit 605c2adb41d81b7050a183d3088fa9e486c8c7f4
8 changes: 4 additions & 4 deletions Modules/_io/bytesio.c
Original file line number Diff line number Diff line change
Expand Up @@ -839,7 +839,7 @@ _io_BytesIO_close_impl(bytesio *self)
*/

static PyObject *
bytesio_getstate_lock_held(PyObject *op, PyObject *Py_UNUSED(dummy))
bytesio_getstate_lock_held(PyObject *op)
{
bytesio *self = bytesio_CAST(op);
PyObject *initvalue = _io_BytesIO_getvalue_impl(self);
Expand Down Expand Up @@ -869,7 +869,7 @@ bytesio_getstate(PyObject *op, PyObject *Py_UNUSED(dummy))
{
PyObject *ret;
Py_BEGIN_CRITICAL_SECTION(op);
ret = bytesio_getstate_lock_held(op, NULL);
ret = bytesio_getstate_lock_held(op);
Py_END_CRITICAL_SECTION();
return ret;
}
Expand Down Expand Up @@ -1041,7 +1041,7 @@ _io_BytesIO___init___impl(bytesio *self, PyObject *initvalue)
}

static PyObject *
bytesio_sizeof_lock_held(PyObject *op, PyObject *Py_UNUSED(dummy))
bytesio_sizeof_lock_held(PyObject *op)
{
bytesio *self = bytesio_CAST(op);
size_t res = _PyObject_SIZE(Py_TYPE(self));
Expand All @@ -1060,7 +1060,7 @@ bytesio_sizeof(PyObject *op, PyObject *Py_UNUSED(dummy))
{
PyObject *ret;
Py_BEGIN_CRITICAL_SECTION(op);
ret = bytesio_sizeof_lock_held(op, NULL);
ret = bytesio_sizeof_lock_held(op);
Py_END_CRITICAL_SECTION();
return ret;
}
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy