8000 gh-117721: use PyMutex in `_thread.lock` by kumaraditya303 · Pull Request #125110 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-117721: use PyMutex in _thread.lock #125110

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 6 commits into from
Oct 8, 2024
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
fix merge
  • Loading branch information
kumaraditya303 authored Oct 8, 2024
commit d8e8c75b1d4523242c210ed16b68d93ce460c865
15 changes: 0 additions & 15 deletions Modules/_threadmodule.c
BAC7
Original file line number Diff line number Diff line change
Expand Up @@ -883,19 +883,8 @@ lock_repr(PyObject *op)
static PyObject *
lock__at_fork_reinit(PyObject *op, PyObject *Py_UNUSED(args))
{
<<<<<<< HEAD
lockobject *self = (lockobject *)op;
self->lock = (PyMutex){0};
=======
lockobject *self = (lockobject*)op;
if (_PyThread_at_fork_reinit(&self->lock_lock) < 0) {
PyErr_SetString(ThreadError, "failed to reinitialize lock at fork");
return NULL;
}

self->locked = 0;

>>>>>>> 5967dd8a4de60a418de84d1d1d9efc063ad12c47
Py_RETURN_NONE;
}
#endif /* HAVE_FORK */
Expand Down Expand Up @@ -941,11 +930,7 @@ static PyMethodDef lock_methods[] = {
{"__exit__", lock_PyThread_release_lock,
METH_VARARGS, lock_exit_doc},
#ifdef HAVE_FORK
<<<<<<< HEAD
{"_at_fork_reinit", (PyCFunction)lock__at_fork_reinit,
=======
{"_at_fork_reinit", lock__at_fork_reinit,
>>>>>>> 5967dd8a4de60a418de84d1d1d9efc063ad12c47
METH_NOARGS, NULL},
#endif
{NULL, NULL} /* sentinel */
Expand Down
Loading
0