Skip to content

Commit c517a8a

Browse files
committed
Revert kqueue_event_init() change
Don't use a critical section on kqueue_event_init().
1 parent f236d71 commit c517a8a

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Add critical sections to :func:`select.kqueue` objects. Patch by Victor
1+
Fix thread-safety issues in :func:`select.kqueue` objects. Patch by Victor
22
Stinner.

Modules/selectmodule.c

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1943,10 +1943,8 @@ kqueue_event_repr(PyObject *op)
19431943
}
19441944

19451945
static int
1946-
kqueue_event_init_lock_held(PyObject *op, PyObject *args, PyObject *kwds)
1946+
kqueue_event_init(PyObject *op, PyObject *args, PyObject *kwds)
19471947
{
1948-
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(op);
1949-
19501948
PyObject *pfd;
19511949
static char *kwlist[] = {"ident", "filter", "flags", "fflags",
19521950
"data", "udata", NULL};
@@ -1990,16 +1988,6 @@ kqueue_event_init_lock_held(PyObject *op, PyObject *args, PyObject *kwds)
19901988
return 0;
19911989
}
19921990

1993-
static int
1994-
kqueue_event_init(PyObject *op, PyObject *args, PyObject *kwds)
1995-
{
1996-
int res;
1997-
Py_BEGIN_CRITICAL_SECTION(self);
1998-
res = kqueue_event_init_lock_held(op, args, kwds);
1999-
Py_END_CRITICAL_SECTION();
2000-
return res;
2001-
}
2002-
20031991
static PyObject *
20041992
kqueue_event_richcompare(PyObject *lhs, PyObject *rhs, int op)
20051993
{

0 commit comments

Comments
 (0)