Skip to content
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

gh-123828: fix data raceing for _waiting_release method in _interpchannelsmodule.c #124107

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
Next Next commit
gh-123828: fix data raceing for _waiting_release method in _interpcha…
…nnelsmodule.c

Signed-off-by: Manjusaka <me@manjusaka.me>
  • Loading branch information
Zheaoli committed Sep 15, 2024
commit ffee4ed2537e3e8ab587f7042ba91841d9c7a45b
3 changes: 2 additions & 1 deletion Modules/_interpchannelsmodule.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* interpreters module */
/* low-level access to interpreter primitives */

#include <stdbool.h>
picnixz marked this conversation as resolved.
Show resolved Hide resolved
#ifndef Py_BUILD_CORE_BUILTIN
# define Py_BUILD_CORE_MODULE 1
#endif
Expand Down Expand Up @@ -490,12 +491,12 @@ _waiting_release(_waiting_t *waiting, int received)
assert(!waiting->received);

waiting->status = WAITING_RELEASING;
PyThread_release_lock(waiting->mutex);
if (waiting->received != received) {
assert(received == 1);
waiting->received = received;
}
waiting->status = WAITING_RELEASED;
PyThread_release_lock(waiting->mutex);
}

static void
Expand Down
Loading