Skip to content

[3.12] GH-110455: Guard assert(tstate->thread_id > 0) with GH-ifndef HAVE_PTHREAD_STUBS (GH-110487) #110491

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 1 commit into from
Oct 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Guard ``assert(tstate->thread_id > 0)`` with ``#ifndef HAVE_PTHREAD_STUBS``.
This allows for for pydebug builds to work under WASI which (currently)
lacks thread support.
4 changes: 2 additions & 2 deletions Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,10 @@ static void
unbind_tstate(PyThreadState *tstate)
{
assert(tstate != NULL);
// XXX assert(tstate_is_alive(tstate));
assert(tstate_is_bound(tstate));
// XXX assert(!tstate->_status.active);
#ifndef HAVE_PTHREAD_STUBS
assert(tstate->thread_id > 0);
#endif
#ifdef PY_HAVE_THREAD_NATIVE_ID
assert(tstate->native_thread_id > 0);
#endif
Expand Down