GH-110455: Guard `assert(tstate->thread_id > 0)` with `#ifndef HAVE_PTHREAD_STUBS` (GH-110487)

This commit is contained in:
Brett Cannon 2023-10-06 16:12:19 -07:00 committed by GitHub
parent f013b47504
commit 5fd8821cf8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -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.

View File

@ -263,10 +263,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