Skip to content

Commit ca59d75

Browse files
[3.15] gh-149816: add missing critical section on self in buffered_iternext (GH-150295) (#150305)
gh-149816: add missing critical section on self in buffered_iternext (GH-150295) (cherry picked from commit e8545ed) Co-authored-by: Kumar Aditya <kumaraditya@python.org>
1 parent 8a162b2 commit ca59d75

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Modules/_io/bufferedio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1509,7 +1509,9 @@ buffered_iternext(PyObject *op)
15091509
tp == state->PyBufferedRandom_Type)
15101510
{
15111511
/* Skip method call overhead for speed */
1512+
Py_BEGIN_CRITICAL_SECTION(self);
15121513
line = _buffered_readline(self, -1);
1514+
Py_END_CRITICAL_SECTION();
15131515
}
15141516
else {
15151517
line = PyObject_CallMethodNoArgs((PyObject *)self,

0 commit comments

Comments
 (0)