Skip to content

Commit 2d94a6e

Browse files
[3.14] gh-149816: add missing critical section on self in buffered_iternext (GH-150295) (#150306)
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 67336ab commit 2d94a6e

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
@@ -1497,7 +1497,9 @@ buffered_iternext(PyObject *op)
14971497
tp == state->PyBufferedRandom_Type)
14981498
{
14991499
/* Skip method call overhead for speed */
1500+
Py_BEGIN_CRITICAL_SECTION(self);
15001501
line = _buffered_readline(self, -1);
1502+
Py_END_CRITICAL_SECTION();
15011503
}
15021504
else {
15031505
line = PyObject_CallMethodNoArgs((PyObject *)self,

0 commit comments

Comments
 (0)